Definitely a bit of a perplexing problem. I'm thinking that it has to be a hybrid solution. Perhaps an IR beam at the door could trigger "sensing mode". In this instance, if the PIR fired after the IR beam was broken within a 5 minute timeframe then "occupied" would be set and the light would remain on. Conversely if the PIR didn't fire, then the light would go out.
Of course, if somebody was in the room reading and another person walked in then walked out again then the system might falsely conclude that the room was unoccupied...
Ideally, some sort of active detection is required. We can easily tell if a room is occupied by sight alone so ultimately, detection has to be either visually or IR driven by a sophisticated pattern recognition program.
Interestingly, this capability is closer than we think:
Home Automation using a Microsoft Kinect
Edited by kwilcox, 18 March 2011 - 03:17 PM.