God tells us very plainly not to avenge ourselves (Ro 12:19), yet He also makes provision in His Law for His people to avenge the death of a loved one, and He evidently wants us to do this. (De 19:12) Thus, while it’s true that vengeance belongs to God alone and not to us, there are evidently times when He chooses us to be the instrument of His vengeance and to deliver it on His behalf.
As we exact revenge on our own, we seldom do so with the right heart; our wrath doesn’t work the righteousness of God (Ja 1:20); righteous anger is indeed a rare thing. Yet when God sets the boundaries on when and how we’re allowed to take revenge, He is keeping us within His standards and ordering our steps in His ways.
After all, as warped as our desire to get even generally is, it is based on a desire for justice, and justice is generally a good thing; it’s a deterrent to evil and places the ultimate cost of malevolence on the perpetrator rather than the victim. When a legal system aligns with God and allows us to take proper revenge, this is holiness.
What God forbids is taking matters into our own hands; He sets the stage for revenge in the context of impartial community which agrees on the legitimacy, method, timing, and degree of our response. Apart from such a legal system, we must leave restitution entirely in God’s hands.
Even so, though we’re not allowed to avenge ourselves per current legal standards, we may certainly desire justice (Re 6:10), even rejoice when it’s carried out, and this might indeed be righteous. (Re 19:1-2) When justice is sought so God Himself might be vindicated, for He is the one primarily and mostly wronged in every offense (Ps 51:4), our interest in justice may then be upright. (Ps 119:84)
Yet how do we integrate love for mercy into our love for justice? How are we to do justly as well as love mercy? (Mi 6:8) We do it by loving our neighbor, desiring what’s best for him, which is to be reconciled to God and to walk in His ways.
When repentance is already present (Ex 20:6), or if we have evidence that mercy will further reveal the goodness of God and encourage repentance (Ro 2:4), then mercy is very likely appropriate. (Mt 18:33) Otherwise, justice is likely best, for offender, victim, and all within society. (De 19:20)