Over the past week or so I've noticed that my iPhone will just turn off on it's own, and just hitting the top right button and holding it doesnt do the trick to turn it back on, I have to hold it for a while....
This is a bug with OS3.1, mine has been doing exactly the same thing and only a hard reset will awaken it, I checked on the apple support site and there is a 67 page thread of people experiencing the same problem.
The only way to address this is to roll back your iPhone OS to OS3.0.