12 You turned my wailing into dancing for me.
You undid my sackcloth and girded me with joy,
13 So that my heart might sing praise to you and not be silent.
O Yahweh, my God, forever will I praise you!
 Here is a possible allusion to the shema of Deut. 5 with the exception that Israel has been replaced with Yahweh; thus, now the routine call to obedience has been turned back to Yahweh. It is now he who must respond to the shema.
 The repeated vocatives (Yahweh) stress the urgency of the poet's cries.
 The phrase לְמָחוֹל לִי reflects עֹזֵר לִי of vs. 11. It is an interesting construction, which most translations have neglected to represent. In vs. 11, the lamed is one of advantage, signaling who the desired object of the substantival participle may be. However, in vs. 12 it is more difficult to deduce what is meant by this construction. However, it makes perfect sense in Hebrew to assume the same semantic function of the form, only it is clunky to translate it into English (though I have tried, above: “...dancing for me”.
 Here, the poet paints a picture of God re-clothing him: taking off the mourning clothes and replacing them with metaphorical attire that is more suitable for his new attitude.
 Cf. The NET Bible's notes on this verse. I agree with their judgment that the text should be emended so that it reads my liver כבדי, commonly seen throughout ANE culture as being the source of happiness; however, heart rather than liver makes the most sense in our own.
 The form לעולם (forever) is fronted for constituent focus: it adds additional information to the proposition that the poet will praise God and specifies the duration of this activity; after all, now that he has been delivered from Sheol, he can say that his praising days are not over – that he can praise him now forever.