I will try it out for you when i get home from work. But when you say you "detach the external display and close the lid, the laptop does not fall asleep" do you mean with or without nosleep/caffeine running?
That was with nosleep running

So even nosleep can't keep the laptop awake with the external screen attached, but without it, it works. Go figure
As to your second point, i understand that it's annoying being "forced" to use it plugged in but i don't think you've characterized the logic quite right. they're not trying to force you to leave both displays on and run down your battery, they want you to plug it in when you're running the TBD or whatever display. you obviously don't have a TBD or you'd be able to plug it in
That doesn't compute. Or what you're saying is, "they want you to not use your computer on battery if you're using an external display, by making the experience really bad and making sure the battery lasts longer". The fact of the matter is that the laptop is running on battery, and that not having the internal display active would make the battery last longer. And therefore neither one of our respective "what they want you to do" makes any sense — which is why I'm saying that it really has to be a bug.
It reminds me of my now dead Galaxy S II. When it reached 5% battery, it'd automatically turn on the screen with a warning in a dialog with an OK button to tap. Until you tapped the button, the screen would stay on. The exact worst strategy for an almost depleted battery

That was most definitely a bug, too.
so theoretically what should happen is if it's hooked up to an external display and running off AC power and you unplug it so that it switches to battery, your computer should sleep whether the lid is open or not. are you saying that's not what's happening?
Well, no, that's not what's happening with the lid open. I'd never expect it to do that. I would expect that to happen with the lid closed, which is also what's happening. But re-waking it via a bluetooth HID — while now running on battery — I wouldn't expect it to put itself to sleep again automatically, and permanently, some ten to twenty seconds later.
i have noticed that sometimes mine will run my TBD not plugged in and sometimes it won't, but it ALWAYS goes to sleep if it's running the TBD while powered and i unplug the magsafe.
edit: ok - i read your OP a little closer. You plug your laptop into your display and it works fine, but when you close the lid it sleeps.
like i said, i will play around with this a bit when i get home but i think maybe i've had some "luck" getting it to run my TBD without actually plugging it in. never while in clamshell mode though. this is definitely by design, clamshell mode requires power.
Oh, yes, now I see that my reply above is unneeded

If this really is by design, it's really really horrible design. I bought an external keyboard because I'm not allowed to turn off the internal display while having an external display attached, and now I find that I'm not even allowed to use it like this without AC power either. It's absolutely horrible!

Apart from meaning that I now get less battery time when it could mean I got more, it also means I cannot get 24fps playback in XBMC via HDMI without bringing a power adapter...
That is so retarded. Please let me know if you figure out how you managed to do it on your computer.
Perhaps I should ask the nosleep devs — it works without an external display, so it seems it oughta work with one as well.
EDIT: LOL — this is the first request on the issues tracker on nosleep's google code page
