Verses 1-8 are linked to the Hebrew letter Aleph. The section is in two parts. Verses 1-4 describe those whom God blessed and verses 5-8 are the responses of the psalmist to the description.
Why are they blessed? They are so because they put God’s demands above everything else. The psalmist does not suggest that they are sinless, although his description of them means they live in such a way that no-one can accuse them of disobedience. Verse 1 describes their outward behaviour (‘Blessed are those whose way is blameless, who walk in the law of the Lord!’) and verse 2 describes their inner desire (‘Blessed are those who keep his testimonies, who seek him with their whole heart’). The Bible will keep those who obey it from sinful practices (v. 3). As it used to be said, ‘Sin will keep you from the Word or the Word will keep you from sin.’
Of course, God does not want a mere outward conformity to his law; instead he wants careful obedience of all his requirements from the heart and mind (v. 4). Alexander Maclaren commented: ‘To keep God’s testimonies is at once the consequence and the proof of seeking Him with wholehearted devotion and determination.’
The description of such a life and the connected blessing causes the psalmist in verse 5 to pray for such a lifestyle (‘Oh that my ways may be steadfast in keeping your statutes!’). Such a prayer is always answered by God. ‘Divine commands should direct us in the subject of our prayers’ (Spurgeon).
The psalmist explains in verse 6 that God will give comfort to those whose lives are marked by comprehensive obedience of all his commandments. The comfort is that the devout psalmist will never be ashamed either in this life or on the Day of Judgement (‘Then I shall not be put to shame, having my eyes fixed on all your commandments’). The sure way to miss out on divine blessing is to practise selective obedience, to decide that we don’t need to keep one or more of his commandments.
The outcome of prayer and realised security is dedication (vv. 7-8): ‘I will praise you with an upright heart, when I learn your righteous rules. I will keep your statutes; do not utterly forsake me!’ Yet the psalmist expresses his fear, which is that God will forsake him. Why does he have that fear at a time of dedication? The answer is that he knows that even his best is not good enough. It is when a Christian is most dedicated that he realises his imperfections. Therefore true dedication is always accompanied by prayer for God’s gracious help and presence.