I take back what I said above about the first two bytes. They must be related to the script somehow, but I don't know how. The script is actually the last two bytes of what I bolded as stated in the original post.
I have found how trainer battles are scripted. I will update later with some examples. These are done in two different ways. One strictly from the event file and another through the scripts.
Pichu2000, do you know if there is any place that stores which event files and script files are associated for a certain map?