Is it possible to write a script to change the Energy Saver settings in OS X (10.7.3)?
Look for the section titled "Changing Power Management Settings" in this MacScripter guide. An AppleScript example from the guide:


do shell script "pmset sleep 30" with administrator privileges