Harm
After a certain level, getting soulfire1 on armor or shield is just... something almost2 everyone should do. It provides immunity to a large range of extremely nasty effects, like [Death], negative levels, and negative energy.
It’s somewhat expensive (+4-equivalent, so a +1 soulfire armor or shield is a minimum of 25,150 gp), but the gold is a pittance compared to the costs associated with not having the protection it provides. If the other cleric can cast harm, he is a minimum of 11th level, which means you should have a net worth of approximately 66,000 gp – and roughly 17,000 gp should be from the last level alone, and by next level you should have another 22,000 gp. You are right about at the point where soulfire becomes eminently affordable, and the dangers it protects against are becoming too frequent to ignore.
This will shut down any backstab attempts by the evil cleric that revolve around harm, but more importantly, it will protect you against all manner of truly devastating attacks favored by undead and fiends. Thus, it is a good investment even if you never are betrayed.
Wrack
As for wrack, that one is harder. Favor of the martyr3 protects against it explicitly, but it’s a 4th-level paladin spell. You’re going to need a high level paladin (or a mid-level archivist4 who has worked with a high-level paladin in the past and gotten it into his prayerbook), and when cast as a spell it lasts only 1 minute/level, which is not the sort of protection you need. Thus, it’s going to have to be used to make a custom magic item – something that is going to need the DM’s explicit assistance.
Luckily, there are other options! On the low end, a ring of counterspells is typically filled with greater dispel magic, to prevent you from being dispelled, but using yours for wrack would be a solution – it only prevents one use of wrack, but it means your foe has alerted you to his backstabbing, and used up his turn. Now it’s yours, and you should have something pretty nasty to respond with.
Note that, if you can get the custom-item of constant favor of the martyr, that is the superior option. Like soulfire, favor of the martyr provides a lot of very nice protections, plus it will stand up to multiple wrack attempts.
But while we’re on the subject of rings, consider a ring of spell-battle5 – they are excellent at providing you with awareness of what magic is going on around you, and, once per day, they allow you to redirect a spell. Dude tries to nail you with wrack? You’re automatically alerted to the spellcasting, given the opportunity to make a Spellcraft check, and if you succeed, you get to wrack him, instead.
And again, the ring of spell-battle is a great general-purpose item, worthwhile even if you are never betrayed.
1 Book of Exalted Deeds
2 Undead should skip soulfire, having immunity or better to everything that soulfire provides protection against.
3 Spell Compendium
4 Heroes of Horror
5 Complete Arcane