SQL to help identify schemas that have been deployed.
Consider using Stylus Studio (XML/XSLT tools) along with Biztalk.
Some items in the removed assembly are still being used by items not defined in the same assembly, thus removal of the assembly failed.
This article includes SQL to identify the offending maps.
Do user (non-Biztalk) databases running SQL 2005 work with Biztalk 2004?
Finding the equivalent SQL stored procs to do what you do by mouse clicks in HAT.