I know that the commands themselves work that way, but the settrainerflag 0x0 command may be equivalent to a standard clearflag 0x500 (trainer flags are just regular flags starting at 500 if I remember correctly) so there is a chance that the main names for the commands are misleading. The only way to really tell would be to take a clean rom and right off the bat, checkflag 0x500 and see what it holds.
Proof- I wrote a working script to make every trainer in the game ready to battle again. It didn't work when I logically used cleartrainerflag, so when I switched to setrainerflag, everybody wanted to battle again.
Edit: Comrade likes your Signiture.
Derp, I always forget some detail. :D
You are right about the trainer flags, they do work differently (and in my opinion they should be named in script editors more consistently with other flags). The script should still work if you remove settrainerflag (you don't have to remove settrainerflag but it's a pointless command using up space, where it is right now) and change this part:
if FALSE jump @done
It's often easy to confuse/generalize on commands that appear to work in the same fashion. Sorry for any confusion last post caused.
I'm glad comrade likes my signature, I was originally going to leave it under maintenance forever :P