I think the 5th level Priest spell "Chaotic Commands" works well as a ward against confusion and chaos spells. Trouble is, it only affects 1 character. I also know there's a lot of items in the game you can pick up that make you immune to confusion and chaos. Lilarcor, the talking sword, is one of these.