Are verses 4-6 a confession of David? Or at least a corporate confession of mankind’s ultimate problem: how can we sinners be in a good relationship with a holy God?
If we’re all sinners, then what separates the wicked from the godly? Answer: David can only enter God’s house because of the LORD’s covenant faithfulness (v 7), and the wicked are guilty because God declares it (v 10). Their sins truly condemn them, but David has these same sins – however, he believes that the LORD’s mercy will lead him in paths of righteousness.
David does not trust that he has the answer to the problem – he believes that the only answer is with God – and he casts himself on God’s mercy and waits (v. 3). Contrast this with the wicked, who believe that they have answers: let them be consumed by their own traps/counsel/logic (which is really death).