Script tags are scoped to the app that created them. When an app is uninstalled from a shop, all of the script tags that it created are automatically removed along with it.
What you can do with ScriptTag
The Shopify API lets you do the following with the ScriptTag resource. More detailed versions of these general actions may be available: