Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I have had this problem often, just tonight in fact. I do not shutdown I just put my MB to sleep, but at times it does not wake up again and needs to be turned off.

I am using 10.5.2. like you.
 
I hasn't actually done it since 10.5.2 but I have had this happen a few times before. Thinking about it, I think it was worst in 10.5.0.

What sometimes works is pressing the power button (not holding it down, just pressing it once) which, eventually, brings the screen back with the "Are you sure you want to shut down your computer?" dialogue.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.