What would cause a MacBook to restart instead of shutting down or sleeping?
Have you tried resetting the PRAM?
Do it from Open Firmware - as your Mac restarts hold ⌘ + OF 
when you get to the prompt type


  reset-nvram
  Press Return
  reset-all
  Press Return


it might work