I find that even with my own .c script, not one of the compiled .x scripts, the [Train] button is disabled when trade is underway.