Not to mention that magnets cause even Macbooks with SSD drives to enter sleep mode. Try it with an iPhone or iPad, or any other device with a magnet (as others have indicated, don't do this if your hd isn't solid state).
Yeah, it seems to trick the mechanism that detects the lid is closed. It took me a while to discover why my work laptop would go to sleep as I was typing, when I had it stacked on top of my (closed) personal laptop.