grab that code, combine it with the plugin example and an infinite loop in pluginstart(), and tadam, Plugin.
Just that as i warned, it will cause errors in AB if you dont first shutdown your running plugins in the ongm event.
We dont have any way that i know off in AB to "read" the announcement messages (so unless thats what the onFoundGameMaster do, then no luck here).
But i do know the onFoundGameMaster got fired yesterday when i saw a gm online so it appear to at least partially works. Just add a few stopplugin("path/path.dll") where you change the path to be your running plugins in the onGmFound block and your set. When a gm is detected, it would stop all your running plugins, then stop itself