Well actually, if guns are the cheapest weapon to research and you can cram them on and swarm enemies with armour, it makes some sort of sense. But otherwise, yeah it makes a lot of sense to pick something for which there isn't a counter yet.
You know I was thinking about this and maybe it would help to work up the pseudo-code to address these AI issues.
For example, taking the example of fleets or ships trying to determine which enemy fleet or ship to target, let's say that the AI has a list of enemy ships and its own list of ships. It considers two fleets the same as one big group if they're within a week's travelling distance of each other. Then all the fleets or groups are ranked by strength.
Find my first group.
Find the first enemy group.
While I have groups without new orders:
If enemy group is an unarmed scout, find next enemy group.
Else if my group is unarmed and unescorted, evade nearby enemy groups.
Else if my group can attack its current target this turn with a reasonable chance of success, attack now.
Else if my group is escorting transports to target or home, find my next group.
Else if the attack counter has been incremented half as many times as I have groups:
If the escort counter has been incremented a quarter as many times as I have groups:
If my group is a small fleet or ship, orbit one of my planets.
else send my group to take up position near my planets to wait for enemy groups.
If I have transports, send my group to escort transports and increment the escort counter.
Else if my Group has a comparable strength to Enemy Group, move to intercept and attack, and increment the attack counter.
Else if I have other groups available, issue a move order to concentrate my groups.
Else find the next enemy group.
There's probably some obvious bugs with this, but you can see what I'm shooting at.