H. C. Leupold denies that the psalmist is actually trying to flee from God, and he is right. David is not wanting to flee from God at all. But he is thinking about what would be the case if a person should attempt it. Leupold suggests that the right idea would be conveyed more effectively by translating verse 7 as, “Where could I go” from your presence...Well, where? In verses 8-12 David imagines three areas in which escape from God might be thought to be possible, but he dismisses each one. 

What are we to do with a God “before whom all hearts are open, all desires known"? An all-knowing God is immensely threatening, which is why we try to banish him from our minds. Arthur W. Pink, whom I quoted yesterday, notes that the thought of divine omniscience "fills us with uneasiness."

The theme of the first six verses is the omniscience of God, the proper term for the fact that God sees and knows everything. But omniscience is not expressed here as mere doctrine. It is confessed in wonder and adoration, as the other doctrines (omnipresence and omnipotence) will also be. We should remember that confession is one way in which we worship God.

Somewhere in J. I. Packer’s writings there is a reference to the Puritan theology as theology of that “older, better, wiser and more practical sort.” That applies to the Puritans, but it applies even more to the theology of Psalm 139. For here is theology that is even older, even better, even wiser and even more practical. It is theology of the very best sort.

In the last stanza of the psalm the writer comes back to his own needs. He knows that God is great, that he has compassion for the lowly and disdain for those who vainly exalt themselves (v. 6). He knows that God preserves his life, that he stretches out his hand in anger against his foes, that he saves him by the power of his strong right hand (v. 7). But still he walks “in the midst of trouble” and cannot survive unless God preserves his life and stands by him (v. 7). So he prays, “Do not abandon the works of your hands” (v. 8).