I've implemented it by checking the System Sleep Energy Saver setting for AC Power... so if you're on a laptop you might want to adjust the System Sleep setting for AC Power under Energy Saver. Or you might want to alter the script so that it checks the setting for battery power.
Even though I'm not using a Hackintosh anymore, I do remember the quest for sleep being a difficult one, so I figured this might help some of you
To run it, just double-click. To have it run on startup, add it to startup items for your user.