Control apertures with combination of CO2 and Temperature

Once you start getting into complex control logic, the EnergyPlus EMS is going to be your friend. You should be able to accomplish what you are after by putting sensors on your CO2 monitor (and maybe on the Room air temperature node) and actuators on the windows.

It’s possible to do this all with additional strings if that is what you have gotten comfortable with but, if this were me, I would implement this by postprocessing the OSM using the OpenStudio SDK as it will take less overall effort and be more reusable.