I don't know how to check if you win or lose either. Just keep the 'after' script vague and word it so you don't outright say "Yay! I won!" or "Grr! I lost" or something like that since we can't determine who won :P
The script in the beginning of FR uses a special type of trainerbattle command (trainerbattle 0x9) in which the player stays in the same position and the script continues, even if they lose - But there is a chance that you'll have to deal with Oak's tutorial throughout the match. In addition, I have no idea how have a different script run depending on whether you win or lose as it only runs the defeat text differently based on the outcome.
I'd suggest playing around with it and to also read this thread that I found which seemed to be trying to do the same thing as you.
EDIT: Oak's tutorial may designated by the 4th byte, so you might not have to put up with it.