"Is there a way to get the right number of electrons and number of orbitals to use in CASSCF from just knowing what atoms or diatomic species are involved?"
The "right" number of electrons and orbitals, is "all electrons" and "all orbitals" if you want to get the correct energy for your given basis set to within 1 Hz precision, for example. This is why wzchem5's comment says that it all depends on your desired precision and computational budget.
In the other extreme, you can use what is called a "full valence active space" which is often considered a "minimum active space". Here you would include all valence electrons of the constituent atoms, and all orbitals in the appropriate shell. For example the carbon atom has electrons in only two p-orbitals, but you'd have to include all three p-orbitals (px,py,pz) because it would not be appropriate to pick only (px,py) or only (py,pz), for example.
If this "minimal active space" isn't good enough for your purposes, there's many options to grow the active space. For example you can include the next shell of empty orbitals, or the next shell of occupied orbitals, or both, or even more. This all depends on the accuracy you want, and the resources that you have available.
This "rule of thumb" that you mentioned, in which the arbitrary limits of 1.98 and 0.02 are chosen for the occupation numbers, is likely meant for systems that are too large for the above strategy. For the systems that you described as examples in your post, it doesn't seem necessary to resort to such an arbitrary choice. For $\ce{Li+-O-}$ there's only 2 possible electrons coming from Li+, and at most 9 electrons coming from O-. If you were to include the 1s and 2s orbitals for Li+ and the 1s,2s,2px,2py,2pz orbitals for O-, then you have only 7 spatial orbitals in total. A CAS(11e,7o)SCF calculation is usually no problem on a computer from this century (it was fun to use the word "century" like this, but "this decade" or even "the last two decades" wouldn't be enough!). Next you can add the three p-orbitals for Li+ and the next s- and p-orbitals for O-, which would take you to a CAS(11e,14o) calculation, which is also easy and probably accurate enough for almost all purposes! Similar analysis will lead to the same conclusion for the other examples that you gave in your question.
Finally I'll say that recently, for example in 2016 people have published papers about "automatically" choosing active spaces, but over the 4.2 decades since Bjorn Roos et al. described CASSCF in 1980 the idea of "automatically" choosing CAS spaces was not very popular, and this was for good reasons. Many experts in the field are still skeptical about the various "automatic" methods for selecting CAS spaces, and there is indeed a "fine art" to the selection of active spaces, which comes with years (or in many cases, decades) of experience.