OK. This gave me an almost heart attack. I thought my 3gs is done forever :(
I guess it started after I received a call and started vibrating with blacked out screen. None of the buttons worked. As you know already, there's no way to take your iPhone battery out or something because of Apples ridiculous design.
For some reason, I got it back to work. Not sure what made it work again, but hopefully this will help any of you in the same situation.
1. I just waited till the vibration stops
2. Removed the sim from the slot
3. Tried pressing both home button and lock buttons at once for 10 seconds. It didn't do anything.
4. Then I plugged the phone to wall outlet and let the battery get some charge. Mine was charged about 70% left when this was happened.
5. When it is plugged in (after about 10 minutes), I pressed the home + lock buttons again and the phone restarted with the apple icon. (Thank god!)
6. It took about 1 minute to restart to the home screen.
Hope this helps.