In my experience, the most common reason for OS X to refuse to shut down is that one of the processes is stuck in state "U", or "uninterruptible". You can check this by opening a terminal window and running "ps -x". Some "U" processes will unstick if the cause is temporary, but it's fairly easy to get apps stuck in what seems to be a race condition in the interprocess comunications subsystem. (Try opening a Mail.app attachment with a slow-loading app and then trying to get Mail's attention while the new app is coming up. Either Mail.app or the new one may wedge in "U".)
AFAIK, if a "U" app doesn't spontaneously unwedge itself, "sudo reboot now" (or "sudo shutdown now") is all she wrote...
What Panther Should Fix: Part Seven, Shut Me Down