Try springrts.com, you can script it with lua.
Or the artful dodger widget, which would make your other units auto-avoid a designated victim unit (by blast radius of nearest enemy)..
This whole AI-Programming into games, feels like cheating to most users pretty fast..