By the time you are doing "different weights per country," You are already on board with what I am seeking. The important part is not the semantics of how the pieces are labeled. Nor is it one of the degree of separation between the pieces when it comes to different nations. The main point, in my eyes, is that they need to recognize from day one that the different nations should be taking different approaches to strengthening their positions and achieving their goals. Just the simple tendency at the moment of every AI driven nation from Germany to France to China to Peru to strive for nearly identical 7+2 infantry templates even if producing those is unrealistic for many nations, points to the serious need for more customization.
Alright, it wasn't clear exactly what you were thinking of in terms of 'scripting'. I usually take that to mean a pretty static sort of orders along the lines of how major nations NFs are 'scripted' in historical currently (literally a list of this is the order of NFs for a given nation). That approach for research/production, I don't think would be very successful but having some different weights for various things for at least the major nations such as land vs naval factor, infantry vs tanks factor, offense vs defense factor, etc would be helpful. This would just make the algorithms needed for research and production simpler and quicker to initially implement since they wouldn't need to spend as much effort calculating these types of factors based on its current situation (not that it couldn't be done).
I don't know precisely how the AI works, but I'd suggest instead of scripting, a 'strategic level AI' is added. That is, an AI that recognizes what position it is in and what long term goals it needs to accomplish to do well. The added benefit to this approach is that the AI will still work with total-conversion mods, while scripting pretty much breaks the AI for them.
Yes, the AI needs a strategic level and I'm sure this exists in some form already (though most would probably agree its not very effective). Also, limiting 'hard coded' factors for specific nations does make things easier for mods and smaller nations that won't get as much love (that being said if you expose different AI values to modders they could adjust the AI per nation as well). The challenge is that this type of strategic AI tends to be one of the more difficult pieces to code. While some of the goals and factors are pretty straightforward, many are extremely complex and the number of possibilities is huge.
One example is the UK which itself has land all over the place and then if you consider its puppets as well then it gets even crazier. Its very difficult to figure out as the UK AI to determine what your goals should be and how you should distribute troops and focus production. The allies historically after the fall of France had a similar problem of not knowing where to best focus their resources (North Africa vs North France vs South France vs Pacific, etc). Should the UK try to only focus on Europe and try to reinforce France before it falls? Should it focus on navy and try to rule the seas by eliminating German/Italian fleets? Should it mass an airforce to provide air superiority in as many fronts as possible? Should it try to defend all its colonies? Which goals it chooses would then influence what unit templates it focuses on which in turn influence what production/research it would go for.
To some extent the comment about choosing something and going for it is better than ending up not doing anything well is true.