this is definitely a constant BUG as the following script shows:

function main()
{

if(is(TRAINMODE))
watch("TRAIN MODE in MAIN\n");
if(is(TESTMODE))
watch("TEST MODE in MAIN\n");

}

1. run the script
2. hit "test" button (any number of times) and "TEST MODE in MAIN" shows for each time...
3. hit " Train" button and both "TEST MODE in MAIN" and "TRAIN MODE in MAIN" show...
4. hit "test" button and now both "TEST MODE in MAIN" and "TRAIN MODE in MAIN" show...

The only way to fix is to restart ZORRO