Is it ok that a MacBook turns on from sleep with the lid closed when MagSafe is connected/disconnected? I have a mid-2012 MacBook (non-retina). Recently I've noticed that after closing the lid to put it to sleep, once it's sleeping if I pull or attach the MagSafe connector to it it will turn on from sleep, with the lid still closed, and go back to sleep after around 30 seconds. 

Is this behavior normal? Should I be worried? Is there a way to disable it?
This should not be happening.  I have this same problem and it started happening after the most recent MacBook Pro and MacBook Air Update 2.0 was installed on 11/9/2012.  Prior to this update install, the laptop would never wake up from sleep when the adapter was connected or disconnected.  Does your also try to eject the DVDROM drive when you unplug it from power after it's been asleep for a while?