Passage
Then shall I not be ashamed, when I have respect unto all thy commandments.
Then shall I not be ashamed, when I have respect unto all thy commandments.
Psalms 119:4 Thou hast enjoined thy precepts, to be kept diligently.
Psalms 119:5 Oh that my ways were directed to keep thy statutes!
Psalms 119:6 Then shall I not be ashamed, when I have respect unto all thy commandments.
Psalms 119:7 I will give thee thanks with uprightness of heart, when I shall have learned thy righteous judgments.
Psalms 119:8 I will keep thy statutes: forsake me not utterly.
The verse centers on "shall", "ashamed", "respect", and "commandments". It is saying that the verse draws attention to "shall" and "ashamed", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 5's "Oh that my ways were directed to..." into verse 7's "I will give thee thanks with uprightness...", so "shall" and "ashamed" belong inside that flow. In Psalms context, the local focus is worship, trust, the LORD's kingship, and covenant mercy.
A plain takeaway is to answer the verse's own emphasis on "shall" and "ashamed" with trust shaped by these words, not by a vague optimism outside the passage.