I hear real irony in the tone of this verse. It is all about the lengths wicked people go to in order to hurt other people. And God brings their effots to ruin in time. Still, this does not stop the wicked from continuing to plot evil. It is human nature to self promote and to hurt others in the process.
David knew what it was like to be attacked by people who made great efforts in their plans of attack. I don't even think he is necessarily speaking of military experiences in this psalm. David had people who were against him at all stages of his life and rise to the throne of Israel. And even though he became king, he had enemies. It is part of the darkness of the sin nature that people can creatively and diligently search out evil.
But when David says that the heart and mind are deep, I hear the ironyy. The plot cannot succeed. God turns their evil plans against them. The nature of sin is that it turns against us... (Psalm 65:8) until our own sinful efforts become our undoing. Often the finest judgment unleashed by God is to let our sinful plans become our judgment. In the way that sin turns against the sinner, the plots of the wicked turn against them by the hand of God to become their downfall. So much for the "diligence" and "depth" of the human heart!