Shazam is apparently not finished when it comes to adding useful features. Engadget reports that the app has recently been updated with the ability to listen for music while it's running the the background.
This new option is called Auto Shazam, and it basically allows you to "set it and forget it." You can toggle Auto Shazam on or off from the home screen and Shazam will do the rest. Whether you leave the app or your iPhone auto-locks, so long as Auto Shazam is enabled and the app is open it will scan your surroundings for music and find the titles for you all on its own.