The fact that you say that the maintenance plan only does things for certain databases makes it difficult to make it dynamic. But if you have some common way of identifying the databases you might be able to use the sp_MSForeachdb stored procedure.
For example to execute some code on all databases with a name starting with UDB
Exec sp_MSForeachdb
'USE [?]IF DB_ID(''?'') LIKE 'UDB%"
DO Something here'
[font="Verdana"]Markus Bohse[/font]