So there is a an ini file that hamachi uses, in the windows serviceprofiles area.
h2-engine.ini
In this file, there is a reconnect line
Reconnect 1 means powered on
Reconnect 0 means powered off
Basically the service I wrote polls that file every so often, if it finds the state powered off, it stops the service, changes that line, and then restarts the service. It also checks to make sure the service is running and also starts it up if the service is stopped. I also keep the hamachi in "do not self update" mode...
The other suggestion is good too.