Just seen that my "question" has not been answered so people may not see the solution! Sorry, probably should have posted up the solution as a fix rather than as a question. Hopefully now it will appear as a solved problem. Regards, Hector
My MB Pro Retina did the same and I resolved (finally - after Apple failed and some 8 months of only using in Clamshell mode) in the end by cleaning the hall effect/reed switch or whatever Lid Proximity switch with contact cleaner. I posted a "question" that explains on this solution yesterday. I tried all the SMC and PRAM resets but problem was the pc thought the lid was closed
Don't know if you resolved this. But my Mac Pro Retina did the same and Apple couldn't sort it. I finally found it was the lid proximity switch (left side between USB and Thunderports and under the logic board) was "sticking" for want of a better word. Basically it would think the lid was closed. I posted a "question" a couple of days ago that explains how I sorted it. Essentially a liberal dose of contact cleaner.
Did you resolve? Likely to be the Hall Effect or Reed Switch that is situated on the left side of the laptop on my 2012 Pro Retina. The magnet on mine is in the lid. If you have had the lid apart then that will be where the magnet goes. Try placing a magnet around the keyboard perimeter and see if it goes to sleep with it in some place (others have found that putting a phone case with a magnet by the side of the laptop has caused theirs to go into sleep mode). If it does go to sleep then your mysterious magnet will be the problem. If not, then the sensor itself may be at fault