1 and 2 are identical, and run scripts after the battle ends (but only if the player won). They except one extra argument: the offset of the script to run. (The script with "trainerbattle" stops running, and the offset you specify starts running.)
3 is a continue-battle. The script that calls "trainerbattle" keeps running after the battle (but only if the player won).
4 is a double battle. It accepts one extra argument: the offset of some text to display if the player does not have two or more usable Pokemon (and hence can't start the battle).
5 is a rematch battle. It's almost identical to 0, but it will actually check the trainer number and do a lookup, to see if you're supposed to battle one of their rematch battles instead. To use this to its fullest potential, you would need to learn more about the rematch functionality.
6 is a special kind of double battle that accepts two extra arguments. I have no idea what the second extra argument is.
7 is a double rematch battle.
8 is a clone of 6.
9 is a tutorial battle. So far as I know, it functions identically to 0 except that the player will not whiteout if they lose the battle. Passing in 0x0003 instead of 0x0000 (as the unknown halfword argument) enables Oak's mid-battle narration.
All other values are treated as type-0 battles.
Note that if the trainer you specify has already been defeated, "trainerbattle" does nothing and the script that calls it will keep running unless you used a rematch battle type. And I think you need an ASM hack to change the music.