I'm applying a similar concept and also thought of starting as you are.
Problem is when people entered clumped up or brought objects in with them (shopping cart...)
Way I got around it is a US sensor crossing the doorway and a PIR sensor inside. So every time US detects sudden change it'll check if there is still movement inside or not and thus knowing if there are none, one or two+ people in the room.
another problem is closing the door, normally that would count as someone coming in/out.
Since the door is an electric sliding one, I solved that by adding increment values into the code. If the increment/decrement of distance the US reads matches the sliding door speed (door is pretty thick, about 10 cm) then that's the door opening/closing(depends on wether increment or decrement) if there is a sudden increment followed by a sudden decrement, someone came in/out.
Here's how it knows how many people are in:
-----no people = no PIR movement
-----1 person = US detected sudden inc/decr + PIR detects movement
-----2+ people = 1 or 1+ people are in and the US detects entrance/exit while PIR detects movement
Hope I helped, or at least got ya thinking
