I said, I will take heed to my ways, that I sin not with my tongue. There are no grounds for connecting this silence with the abstinence from self-vindication mentioned in the preceding psalm (Psalms 39:13, 14).
Indeed, it seems to have had a wholly different origin (see the introductory paragraph). I will keep my mouth with a bridle; i.e. "curb my impatience, restrain and keep in my speech." While the wicked is before me.
The Prayer-book Version is better, if less literal, "While the ungodly is in my sight."