Add an event to the script reload.

This allows scripts being reloaded to clean up after themselves.