139:5 You hem me in behind and before. The verbal imagery is that the Lord lays a siege around the suppliant so that he cannot move in any direction.
you lay your hand upon me. The sense is that of restraint so that he cannot rise farther than the restraining hand. The oppressive hand of God and the saving hand are not identical, but in God’s providence they sometimes seem indistinguishable.
5. “Thou hast beset me behind and before.” As though we were caught in an ambush, or besieged by an army which has wholly beleaguered the city walls, we are surrounded by the Lord. God has set us where we be, and beset us wherever we be. Behind us there is God recording our sins, or in grace blotting out the remembrance of them; and before us there is God foreknowing all our deeds, and providing for all our wants. We cannot turn back and so escape him, for he is behind; we cannot go forward and outmarch him, for he is before. He not only beholds us, but he besets us; and lest there should seem any chance of escape, or lest we should imagine that the surrounding presence is yet a distant one, it is added,—“And laid thine hand upon me.” The prisoner marches along surrounded by a guard, and gripped by an officer. God is very near; we are wholly in his power; from that power there is no escape. It is not said that God will thus beset us and arrest us, but it is done—“Thou hast beset me.” Shall we not alter the figure, and say that our heavenly Father has folded his arms around us, and caressed us with his hand? It is even so with those who are by faith the children of the Most High.
139:5 “And there is no creature hidden from His sight, but all things are naked and open to the eyes of Him to whom we must give account” (Heb. 4:13). And because His knowledge of us is so inconceivably absolute, He can guard us behind and before. Ever and always His hand is laid protectingly upon us.
 MacDonald, W. (1995). Believer’s Bible Commentary: Old and New Testaments. (A. Farstad, Ed.) (p. 769). Nashville: Thomas Nelson.