Each time you use SelectSubUnits, the currently select sub units are unselected... So that would work theoretically. Practically, I find the way it is scripted very prone to error. You have put several tests in the same event, so they must ALL be true to trigger the event. Is it what you want?
Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."