I'm finding the same issue with any script.
The first time the "Test" button causes testing and after the "train" button is used, the "test" button does not change the mode...
>> Restarting Zoro resets something and it will "test" until the "train" button is used...


Code:

if(is(TRAINMODE)) set(PARAMETERS);
if(is(TESTMODE)) set(PLOTNOW,LOGFILE);