David acknowledged the need for an enlarged heart in order to accomplish this. A supernatural operation of God in his life to walk in the way of truth. He understood that works of righteousness do not come naturally or without the supernatural power of God, but also that the works would be a natural result of his heart being enlarged.
What David understood, and much of the church today does not, is that there is a positional AND a practical righteousness. Positional righteousness is that place where we have been brought into right standing with God through the death of Jesus Christ. He has washed and cleansed us by the blood of His Son. We are clean. This positions us directly in the flow of the gift of His grace, the same grace that Christ had while he walked on earth, the same grace that we now have through adoption into the family of God.
The fruit or evidence of that position is practical righteousness. Just as the law defined sin for David, the remedy for that sin changed his behavior. Because of the law working in his heart supernaturally, his works naturally changed as a result. Sin was no longer his master. I have to ask myself why, since we have not just an occasional anointing but an indwelling Holy Spirit do we struggle so with sin? Not only do we struggle with sin, we justify it. We, in effect, say that the blood Jesus did not provide us the same grace that it provided Christ, that Christ gave us less than what He promised, that over the years, grace has become less strong or somewhere along the way, God changed His mind about sin. We expect our lives to be stricken with daily sin and unconquerable vices. But that is not what God's grace does in us when we, like David, experience the supernatural change that David talked about. We receive grace to live above sin and to live holy lives.
Positional AND practical righteousness. Charles Spurgeon describes it this way:
“Have I a man here who declares that he is pardoned, and yet indulges in the sins which he pretends are forgiven? Sir, you have either deceived yourself, or else you are uttering what you know is untrue. He who is forgiven hates sin. We cannot be washed clean if we still persist in living up to our neck in filth. It cannot be possible that a man is pardoned while he still continues to wallow in abominable sin.
‘O yes,’ but he says, ‘I am no legalist; I believe the grace of God has made me clean, though I do go on in sin.’ Sir, it is clear you are no legalist, but I will tell you what else you are: you are no child of God, you are no Christian; for the Christian is a man who uniformly hates sin. There never was a believer who loved iniquity, such a strange thing as a pardoned sinner who still loved to be in rebellion against his God.” — Charles Spurgeon