There are two rather simply things that we should fix in the future:
1. In dotLRN the removal of an applet to a community is not implemented.
2. Though right now with this script you can easily install/uninstall the generated packages, the unistall with APM will fail as soon as an applet was added to a community due to foreign keys constraints in dotlrn_applets, and dotlrn_community_applets. Therefore the relevant entry in apm_package_types cannot be deleted.
P.S. A new version will be available within the next 30 min with a fix to the portlet adps to support shaded portlets.
Greetings,
Nima