Introducing Neverlock a simple daemon that checks for whether or not you have SSH enabled and automatically switches ON/OFF the autolock.When SSH is off it selects the 1min autolock duration.

http://www.modmyifone.com/forums/showthread.php?t=99421