I think I'm confused...what do you mean by how many people are logged into them or not in the labs? If you're using workstations individually, aren't there lab people that can take a headcount, or have it scheduled? Or at least know basically if the lab has no empty seats at peak times? That would be the determining factor quicker than the scripts. We have labs that are full because that is how many students are using them; we don't need more.
Second factor would be the number of drops and available power to the lab area.
Windows itself doesn't have an easy way to tell if someone is logged in or not, at least not reliably. You can use a sysinternals free utility calls psloggedon to tell if someone is logged in remotely or not as a bit of a kludge; it shouldn't be too difficult if you're handy with scripting to script that to call your lab machines, if you're careful about added network load of the polling.
There may be a plugin for Nagios that can also tell this or give you some idea. It may be a good idea to put it in anyway to give you a good picture of your network and workstation usage; but Nagios is more infrastructure than it is just an app to solve this kind of problem. It can take more investment and planning than just "install this and our problem is solved." Google Nagios and you'll have plenty of tutorials and howto for using it.
Personally the added overhead of trying to script it (and hoping the results are accurate - why Windows doesn't have this built in to be easily accessible is beyond me) and maintain it as new machines go out I'd almost prefer just asking the users in the lab (lab people, teachers, whatever your situation is) if there are people who are left without space to work because of workstation shortage. If you ask them users tend to be quite free with complaints to their IT people unless they feel they can't talk to you.