I've been having problems like this too. Sometimes my email sound doesn't go off and when I hit the lock/unlock button it sometimes doesn't make the locking sound. It only started once I put firmware version 2.0.2 on my 3G. Hopefully it'll be fixed on 2.1 or whatever firmware version is coming out next.
As far as getting your sound back. Hold down the home button and sleep button together until you see the Apple logo. When the phone reboots you should be fine. Or some times you can simply turn it off and back on again. This is providing that you have a sound chosen in the sounds menue. You might want to check that first. Version 2.0 and above has had a mind of it's own in regard to messing with settings.
As a side note, I only have this issue and some others when I attempt to use 3g for any extended period of time. Good signal strength or not the combination of 3g and software 2.02 is reaking havoc on these phones.