I’m not sure what the question is here?
In general, the code that has created the event listener is also responsible for managing whether it should be removed as well.
If you want a script to stop listening to events when an entity is disabled, you will need to remove the event listener when the entity is disabled.
Here’s a post to listen for the disabled/enabled event for the scriptType and entity: Is there an event fired for when an entity is enabled/disabled - #4 by yaustar