more information about how to create an extension see the App Inventor Extensions document
however that will be more advanced and will require some Java skills…
I move this thread into category Marketplace for you. Probably soneone is interested to write it for free for you. I also could do it for a small fee. If you are interested in the latter, just send me a PM
EDIT: this PkgUtils : An extension to work with Packages seems to already have the method you are looking for
Taifun