Android OS2.2 used to have an option under Settings/Applications/Development to disable screen lock during USB debugging. After upgrading my Samsung Galaxy S to OS2.3.3 this
I have created an app for this purpose. You can search it on google play "Keep Awake for Debugging" .It will keep your phone-unlocked/screen-on only when you have ADB debugging enabled. It is not restricted to USB only, it works over wi-fi as well.