Bump lol - posted this elsewhere earlier. Needs to be restricted to 10 seconds though otherwise potential exploit for hiding resources from attacks. 10 seconds is plenty of time to cancel, but not enough time to protect resources from a well timed wave of attacks.
As for the problem of using resources to dodge attacks, wouldnt you be in need of more troops in the first place if you have available pop, res and are dodging an attack?
To avoid the hiding resources problem, maybe there could instead be a window that pops up saying "Are you sure you wish to train xxx slingers/hops/horses in *city name* ?"
On the downside it would be pretty annoying to do that every time I wanted to train a unit. So maybe the 10s window is the best we can do.