Yes, your script is very nice. I see someone has suggested handling offline database. I think offline, read only, and suspect need to be handled.
Have you updated the posted source? If so, I think I will want to pull down a new copy since I have very poor T-SQL skills at present.
Thanks.
Mark