Blessings Drawing Torah Close
ובמדרש כי המצוה הזאת כו' ברכת התורה לפני' ולאחרי'
In the Midrash on the verse "For this mitzvah" and so forth, our Sages connect it to the blessing over the Torah recited both before and after — the bircas haTorah.
The Midrash links the verse about "this mitzvah" to the blessings made over the Torah before and after learning.
כי כ' ונעלמה מעיני כל חי כו'
For it is written, "and it is hidden from the eyes of all living" (Iyov 28:21), meaning that the Torah is concealed and beyond reach.
The verse in Iyov teaches that the Torah is essentially hidden and beyond the grasp of any living creature.
ורק בנ"י ניתן להם הכח ורשות בפיך ובלבבך לעשותו פי' לעשותו קרוב
Yet to Bnei Yisrael alone was given the power and the permission, as the verse says, "in your mouth and in your heart, to do it" (Devarim 30:14) — and "to do it" means to bring it close.
Bnei Yisrael alone were given the ability and license to take hold of the Torah and bring it close, through the channel of "your mouth and your heart."
וצריך האדם להכין עצמו מקודם דבר מצוה או תורה ע"י הברכה שמתבונן שהוא ציוי השי"ת ושזיכה אותנו להיות דבקים בו ובתורתו
A person must prepare himself beforehand for a matter of mitzvah or Torah by means of the blessing, through which he reflects that this is a command of Hashem and that He has granted us the privilege of being attached to Him and to His Torah.
Before doing a mitzvah or learning Torah, a person readies himself with the blessing, recognizing that this is Hashem's command and a privilege of attachment to Him.
וע"י הרצון יוכל לעורר ולפתוח פתח להתקרב אל המצוה כנ"ל
And through this desire and yearning a person is able to awaken himself and open a doorway to draw near to the mitzvah, as explained above.
That awakened desire itself opens a doorway, allowing a person to draw near to the mitzvah.
וזה הברכה שמקודם
And this is the meaning of the blessing recited beforehand.
This preparatory awakening is precisely what the blessing said beforehand accomplishes.
ופי' לא נפלאת היא שלא יעלה ע"ד האדם שא"א להשיג כלל בתורת ה'
The explanation of "it is not hidden from you" (Devarim 30:11) is that it should never enter a person's mind that it is altogether impossible to attain anything in the Torah of Hashem.
"It is not hidden" comes to remove the despairing thought that Torah is entirely beyond reach.
ולא רחוקה היא שיוכל להשאר אצלו הארת התורה ומצות לעולם
And "nor is it far off" (Devarim 30:11) means that the illumination of the Torah and the mitzvos can remain with a person forever.
"Nor is it far off" promises that the light of Torah and mitzvos can stay with a person permanently.
וזה ברכה שלאחרי' להיות נשאר אצלו ההארה
And this is the blessing recited afterward — that the illumination should remain with him.
The blessing recited afterward corresponds to this lasting light, anchoring the illumination within the person.
וזה בפיך להתעורר ע"י הדיבור שהיא העיקר בעבודת הש"י להתעורר דברי התורה כמ"ש בנ"י כחן בפיהן
And this is the meaning of "in your mouth" — to be awakened through speech, which is the essence of one's avodah in the service of Hashem, to arouse the words of the Torah, as our Sages said that the strength of Bnei Yisrael lies in their mouth.
"In your mouth" points to speech as the core of one's avodah, since the unique strength of Bnei Yisrael is found in their mouths, arousing the words of Torah.
ובלבבך להיות נשמר בלב מה שהבין והשיג כמ"ש השמר כו' פן תשכח כו' אשר ראו עיניך כנ"ל:
And "in your heart" means that what a person has understood and attained should be guarded within the heart, as it is written, "Only take heed... lest you forget... the things which your eyes have seen" (Devarim 4:9), as explained above.
"In your heart" calls a person to guard within his heart whatever Torah he has understood, fulfilling the warning not to forget what his eyes have seen.
Summary: The Sfas Emes explains the Midrash that connects the verse "for this mitzvah" to the blessings recited over the Torah before and after learning. Although the Torah is in essence hidden "from the eyes of all living," Bnei Yisrael alone were granted the power and permission to draw it close through "your mouth and your heart." The blessing said beforehand awakens a person's desire and opens a doorway of nearness to the mitzvah, embodying the truth that the Torah "is not hidden" and beyond reach. The blessing said afterward corresponds to "nor is it far off," so that the illumination of Torah and mitzvos should remain with a person forever. This is achieved through "your mouth" — the avodah of arousing Torah through speech, the unique strength of Bnei Yisrael — and through "your heart," guarding within what one has understood so that he never forgets what his eyes have seen.