I had to do a similar home-grown approach for a client of mine with many thousands of databases on a single server that we needed to get over to a reporting/DR box. Quite interesting!
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service