Isn't it possible to direct the AI through flavors?
Only for those things where the AI actually uses Flavors. Some tables don't HAVE Flavor declarations, and others (such as Specialists and Improvements) don't seem to use the ones they have. No matter what Flavor you give a Specialist, the AI will only use it if it thinks it gains more yields by using the specialist than it'd get from working a tile instead. The Flavors are ignored, and the AI simply goes by the known yields (and specialist-generated Great Person points) of each.
Likewise, when the AI's deciding whether Improvement A on a tile should be replaced by Improvement B, it compares before-and-after yields to see whether it's worth doing at all; if A was adding something like Happiness, Great Person Points, or some brand new yield you've added, then the AI will see A as worthless and replace it with B regardless of what Flavors you use.
Also, Flavors have limitations. The AI makes its grand strategy decisions based on a lot of non-Flavor factors, so anything you do through Lua after-the-fact simply can't be taken into account. For instance, let's say you've added a supplementary system that adds 10 Happiness to each player while in a Golden Age, through a simple Lua override. So far so good, right?
Okay, what happens when a player is sitting at -5 Happiness from its normal sources? A Human would know that it's okay, that the +10 will bring you up above zero. A Human will also know that in eight turns, that's going to end, so you need to be building Happiness-producers, but there's no need to rush any of them. An AI won't have either of these; it'll react to the -5 the same way it would in a normal game, i.e. emergency Happiness-boosting methods like rushing a +Happiness building, turning on Avoid Growth, and so on). During the GA's duration those actions are unnecessary, and it won't change its behavior once the GA ends.
You can get around this somewhat by using hidden buildings (so the +10 Happiness I mentioned is managed through an actual building in your capital that adds +10), but it still won't work perfectly. (As before, it won't understand that that bonus can/will go away at some point.) And if you're adding an entirely new Yield, then none of the existing AI methods will value it correctly.