Sometimes you want to be able to dock your iPhone and not have the display go to sleep. For example, when you have a 3rd party app like AIM or Twitterrific open that doesn't have a disable lock function. The screen will not lock automatically if the iPhone is docked and music is playing. Simply start playing music and then dock the iPhone and open the app you want to use. The iPhone won't sleep until the playlist, album, or podcast is finished. If you don't want to listen to anything, you can always turn down the volume.
[Ed Note: You can also set the Auto-Lock setting to Never.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20090714083945215