App that creates a snippet on running theme

Hi, i am interested to build a simple app that adds a snippet with HTML and JavaScript content.
i was wondering what will happen when the app is deleted from the store?
is there a way to erase the created snipped as well when my app is removed?

Want to hire me to help you with your theme? looking for experienced Shopify developer?
Mail me - my post solved you problem? you can send me a bonus on PayPal :)