Your chance to hit and be hit are determined by your character level and agility (see
differences between classes - minor spoilers).
I don't think your resistances directly effect your chance of being hit. Perhaps if the damage is dropped to zero, though, the game just counts it as a miss? I suspect the regular imps would also have trouble hitting you consistently.
You could use the save editor to drop your agility, but would have to hex edit (
Some more hex offsets...) to drop your resistances. Maybe I'll try that out if I have time later...
In a new game you could test out an elemental attack, then use the save editor to learn Magic Barrier, save, unlearn the skill, re-load, re-learn, etc to boost your resistances, and then try the same opponent again, to see if you get hit less or if each hit just does less damage.