"Are you sure you want to shutdown your computer now?" is a message that may randomly show up on your computer due to some faulty HW component.
This AppleScript automatically closes the "shutdown / restart" dialogue when the Mac is trying to restart itself.
Example of the issue this AppleScript may help with: https://discussions.apple.com/thread/2537792