In the Apple Support Site, Apple notes that the "Screen Lock" function:
Allows you to set a 4-digit combination to prevent someone else from using your iPod while it is not attached to a computer. When an iPod is locked, you must enter the combination to unlock the screen. This feature is different from the Hold switch in that the Hold switch only prevents iPod from turning on accidentally -- not keeping snoops out.
Screen Lock only locks users out of the user interface. It does not encrypt data on your iPod. For example, if you use Screen Lock and then connect your iPod to a computer, you'll be able to manage music on your iPod with itunes
and access all data on it in disk mode (contacts, notes, and any other files you have stored on the iPod).
This support document also provides additional information on locking and unlocking the iPod. According to Apple, if you have forgotten the code, you can unlock the iPod by doing the following:
Connect your iPod to the primary computer you use it with (the first one iPod synced with), and open iTunes. When you disconnect iPod from the computer, it will no longer be locked.
If you can't unlock iPod using either [the code or connecting it to the computer you use to manage its songs]. . . you can restore your iPod to factory settings using iPod Updater. Please note that this will erase all data on your iPod.
Afterwards, you can add your music and data back to your iPod.
If you want to change the primary computer that your iPod is associated with, do this:
1. Restore your iPod. Warning: The restore process cannot be undone. All of your songs and files will be deleted.
Always make a backup of your important data.
2. Connect your iPod to the computer that you want to be the primary computer.
3. Open iTunes and synchronize.
Apple also notes that company "representatives cannot unlock an iPod if you forget your combination. If you can't unlock your iPod and you don't have access to the primary computer, your only option is to restore the iPod, which will erase all music and data."