Just a reminder that scholars suggest this psalm technically continues the previous. The Septuagint Old Testament, favored by New Testament authors, has it as one.
It’s sad how much is lost in translation here. David willingly throws himself on the mercy of the divine court. If it is David who needs correction, let God cleanse him of sin. Otherwise, let divine wrath fall on those who persecute him. Perhaps we could translate the second line as “contend for my contention,” as the Hebrew words are that closely related. His contention is against some unnamed Gentile nation, though it may be merely a figure of speech, as is the next line about deliverance from those who are deceitful. It’s not so much the people as the violation of God’s revelation that bothers him.
The point here is that God is pictured as the sovereign ruler with authority to act, and a presumption that nothing about this is a mystery to Him. David has committed his life to conforming to God’s character within Creation. Thus, God is his refuge in all sorrows and at any cost to David. It’s standard courtly protocol to ask why God might push him aside, not as impertinent as it sounds to us. It’s not even really a question of “how long?” Rather, he urges God to take action as soon as possible. In David’s soul, such action would be itself a revelation of truth. This is how David has lived all his life, seeking to understand with his heart what matters to God in all circumstances. If anything will bring David back into God’s Presence, that is it, the one thing God Himself revealed.
And what a celebration it will be! David promises to appear before God with his best offerings – songs of praise and worship. Again, he tells his soul to pull it back together. Don’t get caught in the lies of depression, because God does things in His own sense of timing. That day will come when God decides, when He wants it to happen.