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
Try this in the adb shell, although it seems not to work on some devices:
svc power stayon usb