I think you are getting some of this, and these principles are coming together as to why these psalms would be curses in this way. This is a good template for the other imprecatory psalms. It is a lament or a cry for help with a few verses of imprecation to implore God to act on his or her behalf, and then asking for blessings on the righteous.
Now we do not know all the circumstances of David's life at this time, but he expects God to hear his prayer and give him help and guidance in dealing with his enemies. And in verses 4 through 6, he lets God know the wicked people he is dealing with. They are boasters; they are sinners; they are liars; they are bloodthirsty men; they are deceitful. And he knows that God takes no pleasure in sinners like that—in such people.
And then in the next section, verses 7 through 8, he reminds God that he himself—David—is faithful in worshipping Him, and he asks for help in how to deal righteously with his enemies. That is what it says in there in verse 8: "Lead me, O Lord, in Your righteousness because of my enemies; make Your way straight before my face." He is asking Him, How should I work with them? You know, how can I still follow You yet work this problem out?
And then in verses 9 and 10—that is the imprecatory section. He begins with repeating their sinfulness. Their deceitful words aim to bring David to destruction. They want to kill him while they flatter him in hypocrisy. So David asks, "God, please judge them guilty of their sins. Judge them and bring their sentence upon them. Let them be caught in their own deceitful stratagems and even let them be cast out."
Now you can take this as literally being cast out—like banished or outlawed or excommunicated—but such phraseology could also mean that they would be executed. They would be cut off from their people. And all of this he is asking of God is for his enemy's transgressions against God and man. "They're already under a curse. God, speed it up."
And in verses 11 and 12, he returns to the faithful among God's people in his thought, and he asks God to use His vengeance for them as an example to them—that God will act as a shield to them, that they will look and see this example and know that God has worked out a great deliverance, and that they too can share in this if they ask God in faith.