Hmm.
It might be possible by extending the add-on controller but that in itself requires an add-on which would need to be installed.
How come your add on isn't being installed or uninstalled?
Another way is to run a cron job that checks the status of the add on and then run the action depending on its outcome.
Depends how quickly that action needs to occur as to whether that's going to work.