Defend Yourself is a really complex addon for a really simple thing: engaging in melee combat. It does 3 main things:
1) Makes sure you enter combat when you use an offensive spell or ability on a target.
2) When you are attacked, you will enter melee combat with the aggressor
3) If you are attacked by multiple opponents, on the death of one you will immediately target and attack the new one. No forgetting between spells!