IIRC the problem is not with the AI wanting to build anti-air units, but with the AI building anti-air units as offensive/defensive land units because the "unit power" maths is broken and makes them look like super-powerful general-purpose units.
EDIT: This is my original spreadsheet.
Col A is the unit name
Col B is the "unit power" using the broken unmodded DLL code
Col C is the "unit power" fixing the bad maths, but leaving the broken logic around domain based promotions
Col D is the difference between B and C
Col E is the "unit power" fixing the broken logic around domain based promotions (ie a unit should only receive boosts to its power for promotions that operate in its operational domain)
Col F is the difference between B and E
Col G is the "unit power" when restricting anti-air unit to be only defensive (and not offensive) units
Col H is the difference between B and G
From the spreadsheet you can see just how badly the broken maths alone affects the AA units' power score. Which is why the AI builds them as offensive/defensive land units, regardless of whether it actually needs AA units. They are better than everything except Mech Inf, so the AI will never build Infantry once the AA Gun is available, and once the Mobile SAM is available, it'll stop building Mech Inf.