I suppose your worried about town flip for building that temple & library.
I work on those courthouses first in any city more then a few cities from your cap (but not so far away that it does little good) and almost always rush them if you can. If getting those swordsman isn't a urgent part of a war, then you can save your money for a switch to rep or monarch and do some court house rushing.
Also, generally speaking, don't waste money on upgrading warriors less then veteran.(unless you don't have a choice, not enough time to build a sword in a war etc) Using those regular warriors as disposable scouts, captured enemy town pacifiers (you know, the ones that might flip and take your troops with them, like the one your building the library in) etc