This is a problem with all 2012 MacBook Pros that have applied the update DL1609 via Software Update. This update is called MacBook Air and MacBook Pro Update 2.0. The only fix that exists for this is to reinstall OSX and just not install this update when it shows in the available updates list in the AppStore. Just hide it until this issue is fixed by Apple.
If your OSX 10.8.2 version is anything after version (12C60) then you will have this problem. The problem is as follows. With the system asleep with clamshell closed, plugging and unplugging the power cable causes the system to wake up and go back to sleep. Additionally, leaving the system plugged into power for over 4 hours will cause the system to go into hibernation, but only when plugged in. If it's not connected to AC power while sleeping for that long, it will not enter hibernation.
Please call Apple and complain about this problem. I have been working with them for over a month and a half trying to get them to fix this and it's a major hand-holding process because they didn't initially understand the issue. Add to that the fact that they insisted that this problem doesn't exist and it just made it that much harder to get them to see the issue.
You need to call them AppleCare and let them know you're having this problem. Along with that, email the rep you're working with links to every Apple Support Forum thread you can find on this. Trust me, there are several with this same exact problem.