Hang on.
You are 100% correct, there is indeed a big bug there.
The script does not re-enable or disable anything when it is restarted but it does get the current setting from the registry. This means there is a big inconsistancy between the two and you will end up needing to enable or disable it before it would work each time you start it (aka, each time you start Messenger).
You get that when you copy stuff and changing a few things without understanding it