Plenty of command lists are not doing what their owner thinks they are doing. Here is how the engine reads one.
Rules run top to bottom. The first rule whose condition is true fires, and everything below it is skipped for that tick. So if your first targeting rule is always -> target random enemy room, congratulations: that is your entire targeting AI. The clever stuff underneath never runs.
Specific conditions go above general ones
A targeting lane that actually works:
enemy room destroyed -> target that roomalways -> target enemy shieldalways -> target random enemy room
Rule 1 only matches when there is wreckage to pile onto. Rule 2 only does something when they still have shields up. Rule 3 catches everything else.
A rule that cannot act does not waste the tick
This is the part people miss. If a rule matches but its action has nothing to do (aiming at a shield on a ship that has none), it does not fizzle and eat your turn. The engine falls through and keeps walking the list.
So you can stack aspirational rules up top without bricking your weapons.
Two more things worth knowing
The four lanes (power, ammo, targeting, abilities) run independently. A targeting rule can never block a power rule. You are writing four small programs, not one big one.
And random targeting is ship-wide sticky. Every weapon that falls through to it picks the same room and stays on it until that room is gone. Free focus fire, which is usually what you wanted anyway.