I had a major breakthrough last night!
I can choose and predict battle order!!!! I finally broke the last code I expected to be the hardest. Now, while I can select a battle order, note that not every order that could exist in the real world can exist in the game. In fact, the game only has 2^16 different selectable battle orders, and some repeat. Therefore, when doing the TAS, I am still going to be limited by in game restrictions. The big savings will be in minimizing cursor movement, and maximizing the number of times an enemy is killed before it gets its turn in a round.
I've determined Gong is worthless. His movement sucks and he would not help until the 3rd battle, at which point I could get Gort, which I am currently considering.
However, for everyone curious, here is Gong in the first battle, and second battle, showing how far he lags behind.
http://dehacked.2y.net/microstorage.php/info/849079145/WithGong.gmv
Now, for a little bragging. Using the code I developed for determining battle order, I managed to come up with the perfect battle 1.
First Round: Max goes after goblin 7, moves into position, and gets the quick kill.
Second Round: Everyone goes, except Max, goblin 5, and the knight. Max moves in, and kills goblin 5 before it's turn. Knight moves to strike Max.
Third round: Max goes first, killing the knight, and ending the battle.
The chances for having the second round battle order turn out perfect is 0.006%
Here is the result. The battle ends ~62 seconds faster than my first attempt.
http://dehacked.2y.net/microstorage.php/info/1801294615/testqueue.gmv