Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I had same problem with my old MBP with Lion and ML too I think it might have to do with Time Machine. It does the same with my 2 weeks old rMBP with Time Machine too. :apple:
 
How about try boot and shutdown with Verbose mode?

It'll show a text log of what its trying to do when shutting down, versus just showing the spinning gear and grey screen.
 
I had a similar issue and when I shut down in verbose mode it led me to the network setup.

I went into System Preferences > Network and removed the wireless network configuration. I hit apply and shut down the Mac. It shut off immediately. So I turned it back on and went back to networking, hit the plus and added the wireless network back. After applying the settings again, the shut down problem was fixed and my network settings were back. Luckily the plists kept all the data, so deleting/adding back didn't delete the settings themselves.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.