You could probably do this with a hashtable and timers. I am not sure what you mean with all that targeting, but it sounds complicated.
Here's an example
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current research level of Ranger Training - Level 2 for playerElves) Greater than or equal to 2
(Number of units in (Units within 500.00 of (Position of (Picked unit)) matching ((Evaluate MatchingUnit Living Hostile Organic Level 5Plus <gen> conditions) Equal to True))) Greater than or equal to minFoes_Ranger_Locust
(Successful: Order (Picked unit) to (Convert locustswarm to untargeted order)) Equal to True
Then - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within range_Ranger_Quillbeast of (Position of (Picked unit)) matching ((Evaluate MatchingUnit Living Hostile <gen> conditions) Equal to True))) Greater than or equal to minFoes_Ranger_Quillbeast
(Number of units in (Units owned by playerElves matching ((Evaluate MatchingUnit Ranger Living Quillbeast Minion <gen> conditions) Equal to True))) Equal to 0
(Successful: Order (Picked unit) to (Convert summonquillbeast to untargeted order)) Equal to True
Then - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within range_Ranger_Bear of (Position of (Picked unit)) matching ((Evaluate MatchingUnit Living Hostile Ground Unit <gen> conditions) Equal to True))) Greater than or equal to minFoes_Ranger_Bear
(Number of units in (Units owned by playerElves matching ((Evaluate MatchingUnit Ranger Living Bear Minion <gen> conditions) Equal to True))) Equal to 0
(Successful: Order (Picked unit) to (Convert summongrizzly to untargeted order)) Equal to True
Then - Actions
Else - Actions