Took a look at the script and preferred unit choices are good with 3 unit types, I encourage 4 unit types because though it is harder to code for unit preference, the AI can make use of better choices, including units like Dragoons, Flail Elephants (for meat-shield). You are on the right track for using Ranged Infantry units instead of the AI basic choice.
A note using walls for AI: My AIs use 58-59 distance for first wall, 82-84 for second wall. I believe that at least 50 or 55 for first wall allows AI to place Factories and other buildings so that it does not get crammed in maps like Sonora and Himalayas.
I know AI coding is exhausting, so what I do nowadays is sleep in twice a week, drink lots of tea and water, and take care of food and extremities.
Does your AI play treaty or treaty 20?
I don't have definitive edition to test Inca, Swede, or United States AIs.
The Flycatcher (Asian Dynasties AI) on NR Maps for instance, gets 1500 score on Hard by average in a 20 minute treaty.
How does yours do on 40 minute treaty, say on Highest Difficulty on Andes?