Here "to return" is a metaphor that means to cause someone to experience the same thing they did to someone else. Alternate translation: "for God to afflict those who afflict you, and to relieve you" (See: [[rc://en/ta/man/translate/figs-metaphor]])
You can make it explicit that God is the one who provides relief. Alternate translation: "for God to provide relief to you" (See: [[rc://en/ta/man/translate/figs-ellipsis]])