I understand that it is forbidden for a Jew to take revenge. Rambam Deyot 7.7
A person who takes revenge against a colleague transgresses a Torah prohibition, as Leviticus 19:18 states: "Do not take revenge."
And that it is a Mitzvah for a Jew to avenge the killing of his relative (whom he will inherit) Rambam Rotzeah 1.2
It is a mitzvah for the blood redeemer to kill the murderer, as Numbers 35:19 states: "The blood redeemer shall put the murderer to death." Whoever is fit to inherit the victim's estate becomes the redeemer of his blood.
Is it correct to see the second law as an exception to the first?
(What is the best way to look on it?).
Are there other exceptions?
Is it that when someone does something active against you you can avenge (but not letting you borrow something is an inaction, (not active)?
PS Saifer haChinuch revenge