Caffeine won't keep your MBP awake with the lid closed. To do that, use InsomniaX or InsomniaT (rebuild for SL) (fix for 2011 MPBs)
You can also do this:
https://forums.macrumors.com/posts/12150590/
and be able to close the lid without sleeping and without requiring an external device connected.
It was such good advice it deserved an encore.Exactly what was posted in post #5.