There is a far superior app for such a thing. Tasker. You can do so many things using different triggers. Besides WiFi on when plugged in, you can have it launch desk clock when plugged in and its left side. I've got one setting that will enable GPS, wait 1 one second, launch GPS Tracker, then display the home screen anytime it gets an sms from a particular source with a specific message in the text. Another useful setting is to kill the phone app at the end of the call. Instead of leaving you on the phone screen it takes you to the home screen. That way you are less likely to redial your last number. Another good one is to turn on GPS anytime you launch navigator or maps.
You want the phone to automatically call the local library if you place the phone face down between 4:36am and 10:03pm while plugged in USB on odd numbered Thursdays in months without an R? Tasker can do that.
Sent from my (liberated) HTC Liberty using XDA App