It will only be released when you close the project. It will not be released if deleted, because you can press undo and it will come back.
Is there a way to react whenever these changes and undo-points happen in a singleglobal plugin is removed?
For this scenarios:
1. Add a single-global plugin to the project. Then I instantiate additional DOM elements and register listeners in the editor needed for the plugin.
2. Remove the single-global plugin from the project. I need to remove the DOM components and disconnect the listeners.
3. If an undo is executed, I need to re-initialize those components and listeners.
4. If a redo to remove it is done, same as in step 2. I must remove the components and listeners.
Or at least a way to verify if the plugin is currently in the project. Because the inst variable is always set. Thus, I can't validate if it's null.