"You know when I sit down and when I rise up;
You understand my thought from afar.
You scrutinize my path and my lying down,
Think of the little couple seeking shelter that night in Bethlehem. I'm sure they wondered if God could see their predicament. He knew their despairing thoughts. He did see where she laid down to give birth to His Son, when they rose to dedicate Him at the temple, when they sat before the Wise Men who came to worship at their baby's feet. He saw when they had to go flee down the path to Egypt to escape a despot ruler Herod, when they came back home, home to the glaring eyes of those who still looked at Mary as an immoral woman, not understanding and suspicious of why they went to the foreign country of Egypt. Yet God knew, understood, planned out their path, was intimately acquainted with all their ways--past, present and future--so much so that they were chosen as the ones out of all history to be the parents of His Son.
As for us...
This part of the song of David continues the melody of how God knows us, as verse one said, "You have...known me." God has infallible knowledge, intimate knowledge of us. He knows us better than we know ourselves. He is 'intimately acquainted with all our ways.'
Perhaps much of this journey called life, God is working in us to help us to know ourselves, our inner workings, so that our heart can beat in rhythm with His, with His desires. This can happen only once we come to realize what is in our heart that is contrary to Him, that sin that separates us from God. It's called introspection. Then we can open up and allow Him in to cleanse it, to make room for Himself to live, to abide with us, so that we'll be at home, comfortable, with Him as we sit down, when we rise, and when we lie down, when He scrutinizes our path. This is Emanuel, God with us!
"Thou knowest me wherever I am and whatever I am doing,
me and all that belongs to me.
Thou knowest me and all my motions,
my down-sitting to rest, my up-rising to work.
Thou knowest me when I come home,
how I walk before my house,
when I go abroad, on what errands I go.
Thou knowest all my imaginations.
It is often unobserved by ourselves,
and yet thou understandest my thoughts from afar off,
even before I think them,
and long after I have thought them
and have forgotten them.
Or 'Thou understandest them from afar;
from the height of heaven Thou seest into
the depths of my heart.
Thou compassest every particular path,
so as thoroughly to distinguish between the good and evil of what I do.
Thou knowest me in all my retirements;
thou knowest my lying down;
when I am reflecting upon what has passed all day,
thou knowest what I have in my heart
and with what thoughts I go to bed."
So what do you do with a God like that,
one who has come to be Emanuel,
"Come into my heart, Lord Jesus,"
the lyrics of one of the best-loved carols.
all the dialogues, all the colloquies
of the soul with itself."
"Before men we stand as opaque beehives.
They can see the thoughts go in and out of us,
but what work they do inside of a man they cannot tell.
Before God we as glass beehives,
and all our thoughts are doing within us
He perfectly sees and understands."
"Man may not see thee do an impious deed;
But God thy very inmost thought can read."
"Thou compassest my path"
"You scrutinize my path."
This word can also mean, "winnowing, sifting."
"This is a metaphor either from huntsmen watching all the motions
and lurking places of wild beasts, that they may catch them;
or from soldiers besieging their enemies in a city,
and setting round about them."
So God is on guard to catch those beasties that lurk in order to protect and provide for us.
So you might as well let down your walls, open your besieged heart and let Him in.
This is why David was called a man after God's own heart,
because He continually allowed God to break down his walls,
to allow Him in to work to clean up the dirty little secrets of his life,
to rule and reign within.
This is why he had a song in his heart,
why we are blest with these Psalms.