Have you tried issuing a Stop order?
I don't know if that should work though =o
Maybe you can select the building and then in custom script scripts, call ForceUIKey("Insert hotkey for cancelling training here")
The stop thing just MIGHT work.
I don't really know though.