(ד) שְׁמַ֖ע יִשְׂרָאֵ֑ל ה' אֱלֹקֵ֖ינוּ ה' ׀ אֶחָֽד׃ (ה) וְאָ֣הַבְתָּ֔ אֵ֖ת ה' אֱלֹקֶ֑יךָ בְּכׇל־לְבָבְךָ֥ וּבְכׇל־נַפְשְׁךָ֖ וּבְכׇל־מְאֹדֶֽךָ׃ (ו) וְהָי֞וּ הַדְּבָרִ֣ים הָאֵ֗לֶּה אֲשֶׁ֨ר אָנֹכִ֧י מְצַוְּךָ֛ הַיּ֖וֹם עַל־לְבָבֶֽךָ׃ (ז) וְשִׁנַּנְתָּ֣ם לְבָנֶ֔יךָ וְדִבַּרְתָּ֖ בָּ֑ם בְּשִׁבְתְּךָ֤ בְּבֵיתֶ֙ךָ֙ וּבְלֶכְתְּךָ֣ בַדֶּ֔רֶךְ וּֽבְשׇׁכְבְּךָ֖ וּבְקוּמֶֽךָ׃ (ח) וּקְשַׁרְתָּ֥ם לְא֖וֹת עַל־יָדֶ֑ךָ וְהָי֥וּ לְטֹטָפֹ֖ת בֵּ֥ין עֵינֶֽיךָ׃ (ט) וּכְתַבְתָּ֛ם עַל־מְזֻז֥וֹת בֵּיתֶ֖ךָ וּבִשְׁעָרֶֽיךָ׃
(4) Hear, O Israel! ה' is our God, ה' alone. (5) You shall love your God ה' with all your heart and with all your soul and with all your might. (6) Take to heart these instructions with which I charge you this day. (7) Impress them upon your children. Recite them when you stay at home and when you are away, when you lie down and when you get up. (8) Bind them as a sign on your hand and let them serve as a symbol on your forehead; (9) inscribe them on the doorposts of your house and on your gates.
(א) וכתבתם. גם אמרו שהוא כמו קשרם ואחר שקבלו אבותינו האמת נעזוב אלה הבודאים מלבם:
They also said that its meaning is like "bind them about your neck (Proverbs 3:3)." Now since our ancestors received the truth, we will forsake those who employ their heart to invent things.
ת"ר חביבין ישראל שסיבבן הקב"ה במצות תפילין בראשיהן ותפילין בזרועותיהן וציצית בבגדיהן ומזוזה לפתחיהן.
The Sages taught in a baraita: The Jewish people are beloved, as the Holy One, Blessed be He, surrounded them with mitzvot: They have phylacteries on their heads, and phylacteries on their arms, and ritual fringes on their garments, and a mezuza for their doorways.
מצות עשה לכתוב פ' שמע והיה אם שמוע ולקבעם על מזוזת הפתח וצריך ליזהר בה מאד וכל הזהיר בה יאריכו ימיו וימי בניו ואם אינו זהיר בה יתקצרו: הגה ומ"מ אם אין ידו משגת לקנות תפילין ומזוזה יקנה תפילין ולא מזוזה (ירושלמי סוף מגילה ובא"ח סי' ל"ח סי"ב) דמצוה שהיא חובת הגוף עדיפא:
The reward of the mitzvah of mezuzah
It is a positive commandment to write the Shema, the Veyhaya Im-Shamoa, and to fix them on the side of one’s door, and one needs to be very careful in this, and all who are careful in this, their days will be lengthened, and the days of their children. And if one is not careful in this, his days will be shortened. Rama: And in any case, if it's "out of his reach" [i.e. he lacks the funds] to acquire [both] Tefillin and a Mezuzah, let him acquire Tefillin and not Mezuzah (Yerushalmi Megillah, end; O"C 38:12), as a mitzvah that is a bodily obligation is greater.
(ד) מִנְהָג פָּשׁוּט שֶׁכּוֹתְבִים עַל הַמְּזוּזָה מִבַּחוּץ כְּנֶגֶד הָרֶוַח שֶׁבֵּין פָּרָשָׁה לְפָרָשָׁה שַׁדַּי וְאֵין בָּזֶה הֶפְסֵד לְפִי שֶׁהוּא מִבַּחוּץ. אֲבָל אֵלּוּ שֶׁכּוֹתְבִין מִבִּפְנִים שְׁמוֹת הַמַּלְאָכִים אוֹ שֵׁמוֹת קְדוֹשִׁים אוֹ פָּסוּק אוֹ חוֹתָמוֹת הֲרֵי הֵן בִּכְלַל מִי שֶׁאֵין לָהֶם חֵלֶק לָעוֹלָם הַבָּא. שֶׁאֵלּוּ הַטִּפְּשִׁים לֹא דַּי לָהֶם שֶׁבִּטְּלוּ הַמִּצְוָה אֶלָּא שֶׁעָשׂוּ מִצְוָה גְּדוֹלָה שֶׁהִיא יִחוּד הַשֵּׁם שֶׁל הַקָּדוֹשׁ בָּרוּךְ הוּא וְאַהֲבָתוֹ וַעֲבוֹדָתוֹ כְּאִלּוּ הוּא קָמֵעַ שֶׁל הֲנָיַת עַצְמָן כְּמוֹ שֶׁעָלָה עַל לִבָּם הַסָּכָל שֶׁזֶּהוּ דָּבָר הַמְהַנֶּה בְּהַבְלֵי הָעוֹלָם:
(4) It is a common custom to write [God's name,] Shaddai, on the outside of a mezuzah opposite the empty space left between the two passages. There is no difficulty in this, since [the addition is made] outside.
Those, however, who write the names of angels, other sacred names, verses, or forms, on the inside [of a mezuzah] are among those who do not have a portion in the world to come. Not only do these fools nullify the mitzvah, but furthermore, they make from a great mitzvah [which reflects] the unity of the name of the Holy One, blessed be He, the love of Him, and the service of Him, a talisman for their own benefit. They, in their foolish conception, think that this will help them regarding the vanities of the world.
ולבד ההלכות של מסכת מנחות האמורות במזוזה הורגלו העולם לתוספת שמירת הבית לכתוב בסוף השורות חותמות ושמות כל (של) מלאכים ואינם עכובא אף לא מצוה אלא תוספת שמירה. וזו צורת המזוזה וחותמיה:
Specifically regarding the laws of Tractate Menachot that talks about mezuzah, it is commonly practiced in the world to enhance the protection of the home by writing at the ends of lines seals and names of all the angels. This is not a required practice, since it is not a mitzvah, but nevertheless it enhances the protection of the house.
And this is the form of the mezuzah and its seals:

This image is a Mezuzah, complete with Angelic names, found in the Cairo Geniza.
The mezuzah should be erect lengthwise on the length of the doorpost of the doorway, and one should intend that the [word] shema that is at the end of the scroll should be [facing] the outside. Rama: And that is how they practice, but there are those who say that [the mezuzah] is invalid erect, rather its length needs to be inclined towards the width of the doorpost of the doorway [that is to say, horizontally]. And those who are scrupulous fulfill both [opinions] and place the mezuzah at an incline, at a diagonal. And this is how it is proper to practice, and this is how we practice in these places, and one should intend that the top of the mezuzah, where the [word] shema is, should be towards the inside and the last line should be facing outside.
מְזוּזַת יָחִיד נִבְדֶּקֶת פַּעֲמַיִם בַּשָּׁבוּעַ, וְשֶׁל רַבִּים פַּעֲמַיִם בַּיּוֹבֵל.
The mezuza belonging to an individual is examined twice every seven years, and the mezuza belonging to the public is examined twice in a fifty-year Jubilee period.
"examined" whether it rotted or was stolen.
A mezuzah [placed] on private [property] should be checked twice in seven years, and a mezuzah [placed] on public [property] should be checked twice in fifty years, lest a letter has become torn or faded. Since it is affixed within a wall, there is the possibility that it will decay.
A person must show great care in [the observance of the mitzvah of] mezuzah, because it is an obligation which is constantly incumbent upon everyone.
[Through its observance,] whenever a person enters or leaves [the house], he will encounter the unity of the name of the Holy One, blessed be He, and remember his love for Him. Thus, he will awake from his sleep and his obsession with the vanities of time, and recognize that there is nothing which lasts for eternity except the knowledge of the Creator of the world. This will motivate him to regain full awareness and follow the paths of the upright. Our sages said: whoever wears tefillin on his head and arm, wears tzitzit on his garment, and has a mezuzah on his entrance, can be assured that he will not sin, because he has many who will remind him. These are the angels, who will prevent him from sinning, as [Psalms 34:8] states: "The angel of God camps around those who fear Him and protects them."