Very well said. I've started a few month ago on an AI/Bot for 0AD an open source game. Scripting language is JavaScript running on SpiderMonkey. So far I've accumulated thousands of locs, learned a lot about writing fast code against a specific engine and have barely more than a framework. But I still remember the moment the bot did it's first baby steps and actually build a structure to train some scouts and started exploring the map.
Also it became a decent exercise in dealing with abstraction. The code base just explodes if you do not follow DRY - strictly.