How do I prevent a MacBook laptop from sleeping when closed with no external keyboard, mouse, or screen?
I use a program called "NoSleep". It allows me to do exactly that - helps me download updates, for example, while I go home from work. 

You can get it from here:
http://www.macupdate.com/app/mac/37991/nosleep