Тегилим 116:8 Мидраш: Midrash Tanchuma & Devarim Rabbah

כִּ֤י חִלַּ֥צְתָּ נַפְשִׁ֗י מִ֫מָּ֥וֶת אֶת־עֵינִ֥י מִן־דִּמְעָ֑ה אֶת־רַגְלִ֥י מִדֶּֽחִי׃

Ты спас мою душу от смерти, Мои глаза от слез, И мои ноги от спотыкания.

Midrash Tanchuma

(Deut. 33:1:) “Before his death.” Would it cross your mind that he blessed Israel after he died?11PRK 31(suppl. 1):14; see Sifre, Deut. 33:19(342); Deut. R. 11:6. Then what is the meaning of before his death? Before the angel of death. When the Holy One, blessed be He, said to him (in Deut. 32:49-50) “Ascend [this mountain of the Abarim]…. And you shall die,” the angel of death thought that the Holy One, blessed be He, had already given him authority over Moses' life. He came and stood directly above him. Moses said to him, “The Holy One, blessed be He, has already promised me that he would not deliver me into your hand.” He [answered], “The Holy One, blessed be He, has sent me to you; that you are to depart on this day.” Moses said to him, “Go away from here, as I want to praise the Holy One, blessed be He, ‘I will not die, but rather live and tell the acts of the Lord (Ps. 118:17).’” The angel said to him, “Why are you bragging, He [already] has someone to praise Him, (in Ps. 19:2), ‘The heavens recount God’s glory.’” Moses said, “I will quiet them and praise,” as stated (in Deut. 32:1), “Listen O heavens....” He came to him a second time. What did Moses do? He mentioned the explicit name [of God], and [so the angel] fled, as stated (Deut. 32:3), “For I proclaim the name of the Lord.” He [then] came to him a third time. [At that point,] Moshe said, “Since he is coming from the Heavens, I must justify the judgement [of death] upon myself.” He immediately began saying (in Deut. 32:4), “The Rock, His actions are just.” R. Isaac said, “Moses’ soul was hesitating to leave him, and he spoke with it. He said to it, ‘Tell me, my soul, what will you say, since the angel of death seeks to subdue you?’ It said to him, ‘He will not do so to me, as the Holy One, blessed be He, promised me that he would not deliver me into his hand.’ He said to it, ‘Tell me [what you will say] when you see them crying and you cry with them.’ It said to him (in Ps. 116:8), ‘You have delivered me from death, my eyes from tears’. He said to it, ‘Tell me [what you will say] when they try to push you to Gehinnom.’ It said to him (in Ps. 116:8, cont.), ‘my feet from stumbling.’ He said to it, ‘And where will you be walking in the future?’ It said to him (in Ps 116:9), ‘I shall walk before the Lord in the lands of the living.’ When Moses heard this from it, he said to it (Ps. 116:7), ‘Return, O my soul.’” R. Abba said, “Once he was departed, the lower creatures (people) said (Deut. 33:4), ‘Moses charged us with Torah.’ The higher creatures (angels) said, ‘He executed the Lord’s judgments and His decisions for Israel.’ And even the Holy One, blessed be He, Himself, in all of His glory praises him and says (in Deut. 34:10-11), ‘Never again did there arise in Israel a prophet like Moses [...]. For the various signs and portents.’”

Devarim Rabbah

What is “before his death”? The Rabbis said: What did Moses do? He took the angel of death and cast him before him. He blessed the tribes, each and every one in accordance with its blessing. Rabbi Meir said: The angel of death went to Moses and said to him: ‘The Holy One blessed be He sent me to you, for you are departing today.’ Moses said to him: ‘Go from here, as I seek to laud the Holy One blessed be He.’ From where is it derived? It is as it is written: “May I not die but live, so I may relate the deeds of the Lord” (Psalms 118:17). He said to him: ‘Moses, why are you being arrogant? He has those who will laud him. The heavens and the earth laud him every hour, as it is stated: “The heavens relate the glory of God”’ (Psalms 19:2). Moses said to him: ‘I will silence them and laud him,’ as it is stated: “Listen, heavens, and I will speak, [and the earth will hear the sayings of my mouth]” (Deuteronomy 32:1). He came to him a second time. What did Moses do? He invoked the ineffable Name against him, and he fled. From where is it derived? It is as it is stated: “For I will call out the name of the Lord” (Deuteronomy 32:3). When he came to him the third time, he [Moses] said: ‘Since he [the angel of death] is from the Lord, I must accept the judgment.’ From where is it derived? It is as it is stated: “The Rock: His actions are perfect” (Deuteronomy 32:4).
Rabbi Yitzḥak said: Moses’s soul was struggling to depart, and Moses was speaking with his soul, and said: ‘My soul, are you saying that the angel of death is seeking to gain dominion over you?’ It said: ‘No, the Holy One blessed be He would not do so11He would not send the angel of death. – “For You rescued me from death”’ (Psalms 116:8). ‘Are you saying that you saw them weeping, and you are weeping with them?’12Do you see that I am about to die, and people will weep, and you, my soul, will weep with them (See Matnot Kehuna). It said to him: “My eyes from tears”13 Moses’ soul will not cry. (Psalms 116:8). He said to it: ‘Are you saying perhaps that they sought to push you into Gehenna?’14They is a reference to the heavenly beings that place souls which require punishment in Gehenna. It said to him: “My feet from stumbling” (Psalms 116:8). He said to it: ‘To where are you destined to go?’ It said to him: “I will walk before the Lord in the land of the living” (Psalms 116:9). When Moses heard this, he gave it permission. He said to it: “Return, my soul to your restfulness…” (Psalms 116:7). Rabbi Avin said: When it departed, the residents of the lower worlds were lauding him and saying: “Torah, Moses commanded us” (Deuteronomy 33:4). The residents of the upper worlds were lauding him and saying: “He performed the righteousness of the Lord…” (Deuteronomy 33:21). And the Holy One blessed be He lauds him: “There has not arisen another prophet in Israel like Moses” (Deuteronomy 34:10).