As I said, you need to clone structures.
Disable base defenses and make tons of cloned AI-only defenses.
You have to use this fact: The AI first builds the buildings that are higher in BuildingTypes list, so you have to reorder that. TechLevel also has some importance to the order, and if you find that the AI is not building what is it supposed when it is supposed, simply play with Prerequisites.
Make a prerequisite TechLevel -1 invisible insignificant firestormwall aibuildthis building as a prerequisite for all the clones.
This is a HUGE work and requires a LOT of testing. You can find, that the AI builds all the defenses on one side of the base. But you can (like me

)get nice circles around the base. And then you'll find out that those circles become some not-circle, not defending crap (like me :tard: ) and that you need to make map-specific modifications. But once you get this to work, the AI is MUCH better, as you can send a little amount of units to every turret (combining with some WantsExtraSpace).
Tip: Disable AI walls. They just take space. And you can use wall logic to let the AI buid, say , when it has pretty good defense so it can spend money to build 9 TESLA21(the wall) around one TESLA20.