How to enable ssh proxy every time I resume desktop
SleepWatcher will let you run shell scripts when the computer goes to sleep and wakes up.

There are step-by-step instructions at http://theglenbot.com/sleep-and-wake-scripting-osx/ but the premise is pretty simple, there's one script which runs when the computer is going to sleep, and another one which runs when it is waking up.

However, I would also recommend checking out Keyboard Maestro which can trigger events off system wake and a lot of other criteria, and it's a lot easier and more fun to use.