I would recommend not going by percentages, but by how many shields/gold you earn in the process.
It may depend in part on whether you need extra unit production - if you need the city to be producing extra units, it could be worthwhile to build the courthouse to squeeze out the extra shields to save a turn or more on the unit production.
You may want the extra shields to help speed up other building production in that city. However, if you are at a point in the game where you are using gold to rush buildings a lot, then the shield production is probably meaningless.
Also, if you are late in the game and approaching your victory conditions, the city may not build buildings fast enough to actually contribute to your victory conditions one way or another. Saving a few shields over 100+ turns may be more valuable than saving a lot of shields over 20 or so turns.
The ultimate decision is whether you have something else better to be doing with that city. Is saving a certain amount of shields/gold over a certain amount of time more valuable than, say, using a lot of corruption free specialists? Is there an easier way to hit that production "sweet spot" like Aabraxen mentioned (one mine instead of an irrigation, or one police specialist to reduce a corruption)?