Sorry, but I still don't see the usefulness of programming in a treaty that only applies to shared trade routes. If you're close enough to another race for that sort of treaty, you might as well go for a full alliance. If a war breaks out, one of those freighters is eventually going to get destroyed, so you're going to get dragged into the war regardless (although a little later than with a full alliance, and perhaps too late for you to be of any help). Or this whole war goes on under your nose until your trade partner's annihilated, and you lose all their trade routes at once.
If you don't want to have a full alliance with another race, than you're better off without the trade pact, anyway. You're notified whenever any route you receive income from is lost. If you're in a trade pact, you are then forced to join this war. If you're not in this pact, you can still join the war, but now you can do it through the diplomacy screen and possibly get some cash or tech from the race you're aiding out of the bargain.