I have many times been frustrated by small things, like how dwarves sometimes run away 20 squares from a pursuing enemy, then decide they're safe and turn back to head towards the enemy in order to get back inside the fortress. While I could certainly write a suggestion to the effect that they should do this no more, it would be far more expedient if I could fix this myself. The best way to accomplish that seems, to me, to be (optional) external AI bindings.
Basically each faction could optionally be given a replacement AI, which can toggle whether it or the default AI controls individual dwarves. Preferably this AI should be in-game, perhaps as some sort of DLL or Lua-script or something, whichever solution strikes the best balance of ease-of-use/performance. A way to communicate externally would be useful, with say a listening TCP-socket or something of that nature. The ability to have several concurrent AIs with the locking of individual dwarves would be interesting as well.
Implementing this would no doubt take a lot of work, but it would provide quite a few interesting possibilities.
* Intelligent, self-organizing armies to repel invaders
* Easily implemented dig/build templates (just an AI combined with an external program to design/store)
* Increased depth of modding possibilities (sieges with pickaxes and a willingness to dig? With understanding to avoid traps after finding them?)