Yes, I just added a few scientific units to the base using the spawn command (regardless of how many there are on the base), the rest of the scientists were evacuated, only a few people remained (this gives the base some kind of completeness, closes the emptiness).
I can, in principle, make sure that 50 scientists appear in the laboratory (not the number of them on the base at the moment, but the maximum number that can be accommodated in this module), but in this case there will be a lot of people on the base, it’s better already implement it like I did, just make a spawn for 10 civilian units that are dressed like scientists.
I don’t think that it is generally necessary to implement this completely (as many as there are on the base, there are as many of them when defending the base), it is enough to implement it as I did (they constantly spawn in a static number, for example 10 scientists, the rest were evacuated).
Maybe this is not a full implementation of such a function, but just a superficial spawn function, but nevertheless it looks good (scientists spawn even if they are not at all on the base, so that this does not happen, I tied the spawn of these units to one module of the base, if there is no a laboratory has been built, which means that when the base is attacked, scientists will not spawn).