Reduce their <iPower> value, add UNITAI_CITY_DEFENSE, UNITAI_ATTACK_CITY and UNITAI_RESERVE to their list of NotUNITAIs and change their UnitAIs list to only include UNITAI_EXPLORE.
Reducing the iPower value will help the AI understand that they are not powerful when they have 100 scouts. The NotUnitAIs will prevent the AI from building AND using them for those purposes. By only having one UNITAI defined the AI will prefer them for that use but they will still be able to use them for other functions not excluded by the NoUnitAI list. For example, if you remove UNITAI_CITY_DEFENSE from warriors and add it as a NotUnitAI for scouts early in the game the AI will defend with warriors because they can't defend with anything else but once they can build archers they would defend with them and use their warriors for attacking. The AI build descisions for units are heavily influenced by the UNITAI values so fixing these first will greatly improve the AI without any changes to the code.
There are a lot of units that could use similar attention to help the AI understand how to use them better. Also, if Kael feels so inclinded, adding the ability for promotions to modify the UnitAIs and NotUnitAIs for individual units would be a big help, another boost would come from allowing promotions to modify the iPower value of the unit. This would get the AI to understand that highly promoted units are potent adversaries and you could get the AI to use units based on the promotions it has given them in addition to what the base unit was designed for. Imagine if the City Raider promotion also gave the unit UNITAI_ATTACK_CITY, you'd see an improvement in the AIs use of existing units with more experience.