My 2 cents:
1/ Retain living quarters, but change the space occupied by soldier from 1 to 4 (or any numbers you seem fit). It will greatly limit the number of soldiers that each base can house, just like your intention. In addition, living quarters should have a limited ability to heal and train soldiers (if training is available in game). Healing ability must be only limited to minor wounds, so if some of your guys have part of their brains blown off, you'd better send them to somewhere with real Medical Facility.
2/ Laboratories/Workshops will hold 20 people. The first 10 will be hired immediately after construction and take residence at their workplace. The other 10 must be hired manually, and will live at Living Quarters. However, if Living Quarters are full, they will sleep (and eat and stuff) with their fellow eggheads, which will incur "Overcrowded" penalty and reduce overall efficiency of that said facilities. The more people you cram in one place, the greater the penalty.
Formula for penalty:
Example:
In case there is available space in Living Quarters (due to the sudden death of some unlucky red shirts), the facilities with the most heavy penalty will have the privilege of locating their surplus members to that free space first, until their penalty is lesser or equal to their counterparts. If laboratories and workshops have the same penalty, priority will be given to workshops (don't ask me why, I just prefer engineers to scientists).
Example:
If you decide to hire more soldiers while all spaces are occupied, the non-com personal will have to move away. The least "overcrowded" facilities, or laboratories, will be forced to accept more tenants.
However, it's still possible to manually allocate your men. So if the you want to give the eggheads more breathing space, and piss those annoying engineers, you should still be able to do it.
3/ Scientist and engineers should also have monthly wage. It creates a cost curve, and combines with the diminishing utility of additional personal (if you don't have enough space to accommodate them), you have yourself a beautiful supply-demand diagram. Did I mention that the next employee you hire should cost you more the previous?