photoelectric counter sensor to increase/decrease speed code??

Depending how the doorways are arranged, finding a reliable way to count how many people have entered and left the room might prove tricky. Apart from that it all sounds feasible.