Handler scripts inside an Add-on
Bare Bones Approach.
Can simply use an update on a boolean property button to start (add) and stop (remove) a handler.
The button is added to the window manager object, and will be False when blender is loaded (or addon is first enabled)
For testing the button is added to the footer of the text editor. The frame change post handler is used as a test case.
import bpy
from bpy.props import BoolProperty 

def foogle(scene):
    print(&quot;Keep on Foogling&quot;, scene.frame_current)

def toggle_handler(self, context):
    print(&quot;Toggle Handler&quot;)
    if self.toggle_handler:
        bpy.app.handlers.frame_change_post.append(foogle)
    else:
        bpy.app.handlers.frame_change_post.remove(foogle)


def draw(self, context):
    wm = context.window_manager
    self.layout.prop(wm, &quot;toggle_handler&quot;, toggle=True)
    
def register():
    bpy.types.WindowManager.toggle_handler = BoolProperty(
            update=toggle_handler,
            )
    bpy.types.TEXT_HT_footer.append(draw)
    
if __name__ == &quot;__main__&quot;:
    register()