Ah, yeah, it is pretty hard to understand. Basically the first loop does Battler1's SPD Vs Battler2's SPD, the second does Battler1 vs Battler3 (or Battler2 vs Battler1, if there's a two-battler limit), and so on.
Although fork conditions can't directly use [Value Stored in Index], you can fake it by loading said value into a pair of variables and comparin them. This allows for fluid and non-bloated code, since you only need one main compare command, all the other values will be calculated automatically by the loop.
For the draw thing... it's like this. Let's say two players in a two player battle tie on speed. That's 0,0. So the computer has to decide which one wins the tie, so it randomly picks one, and adds 1 to it.
Now, let's say there's a three-way tie. 0,0,0, or 1,1,1 or something. The computer has to randomly pick one to add 1 to, but also one to add 2 to, without being able to add both to the same number. The end result should be 2,1,0 or 0,2,1 or something. If it could add to the same number, the result could end up like 3,0,0... which apart from causing another draw, if there was a forth battler (3,0,0,0 would become 3,0,0,3 or something), also doesn't fix the problem. In fact, this is basically what it does already, with my current draw system.
Finally, let's say there was the maximum, a six-way tie. 0,0,0,0,0,0. Now 5 needs to be added to one of them, then 4, then 3, then 2, and finally 1, without being added to the same number.
And preferably, it'd do this in the same way as the speed engine itself, a fluid system that doesn't require loads of different fork conditions, since you'd need around 216 different forks to take into account every possible combination. Apart from feasible lag that could cause, it would also be beyond tedious to make.
Still, admittedly, it's not a priority. My game is a Pokémon sim, so 1vs1 is the default battle, and the current tiebreak system I have in place works fine for ties between two battlers (it just breaks on three or more). That's the routine at the end of the Speed code, by the by. The one that checks if VAR is equal to VAR, and then does a rand function.
Now, tell me where your brain gave up and died. Mine gave up a couple of days ago when I made this topic...