The third section refers to (thank you robev) Shmiras Halashon, epilogue chapter 2, note:
הג"ה.[ וּבֶאֱמֶת הָיָה נִרְאֶה לִי בְּתוֹרַת עֵצָה, לְמִי שֶׁרוֹצֶה לִשְׁמֹר פִּיו וּלְשׁוֹנוֹ מִדִּבּוּרִים אֲסוּרִים, שֶׁיַּרְגִּיל אֶת עַצְמוֹ שֶׁלֹּא לָשׂוּחַ כְּלָל בְּבֵית הַמִּדְרָשׁ וּבְבֵית הַכְּנֶסֶת, כִּי מִלְּבַד שֶׁהוּא מִצְוָה רַבָּה בְּלָאו הָכִי מִשּׁוּם קְּדֻשַּׁת הַמָּקּוֹם, כְּמוֹ שֶׁכָּתְבוּ הַסְּפָרִים הַקְּדוֹשִׁים, עוֹד הוּא תּוֹעֶלֶת גָּדוֹל לְעִנְיַן כַּמָּה דְּבָרִים: א. שֶׁתִּשָּׁאֵר לוֹ תּוֹרָתוֹ שֶׁלּוֹמֵד בְּבֵית הַמִּדְרָשׁ וּתְפִלּוֹתָיו בִּשְׁלֵמוּת, שֶׁלֹּא יֶחְסַר לוֹ שׁוּם עֲנִיַּת אָמֵן וְאָמֵן יְהֵא שְׁמֵהּ רַבָּא וּקְדֻשָּׁה וּבָרְכוּ. ב. שֶׁעַל יְדֵי זֶה יִהְיֶה לוֹ בְּחֶשְׁבּוֹן יְמֵי חַיָּיו, בְּעֶרֶךְ עֶשֶׂר שָׁנִים, שֶׁלֹּא הָיָה בָּהֶם שׁוּם דִּבּוּר אָסוּר, כִּי אִישׁ הַיִּשְׂרְאֵלִי מָצוּי בְּכָל יוֹם בְּבֵית הַמִּדְרָשׁ בְּכָל תְּפִלּוֹתָיו וּזְמַן מָה אַחַר תְּפִלָּה, לְפָחוֹת בְּעֶרֶךְ אַרְבַּע שָׁעוֹת בַּיּוֹם. וּבִפְרָט אִם יֵשׁ לוֹ גַּם כֵּן עֵת קָבוּעַ לַתּוֹרָה בְּכָל יוֹם בְּבֵית הַמִּדְרָשׁ בְּעֶרֶךְ שְׁתֵּי שָׁעוֹת. לְפִי זֶה בְּעֶרֶךְ חֵלֶק רְבִיעִי מִכָּל הַמְּעֵת לְעֵת מְיֻחָד אֶצְלוֹ לְתוֹרָה וְלַעֲבוֹדָה. הִנֵּה אִם כֵּן מַה טּוֹב יִהְיֶה לוֹ לֶעָתִיד, כְּשֶׁיִּצְטָרֵף חֵלֶק רְבִיעִי מִימֵי חַיָּיו, שֶׁלֹּא הָיָה בָּהֶם שׁוּם דִּבּוּר אָסוּר, רַק תּוֹרָה וַעֲבוֹדָה. ג. שֶׁעַל יְדֵי זֶה יִהְיֶה נָקַל לוֹ מִמֵּילָא בְּכָל הַיּוֹם גַּם כֵּן לִשְׁמֹר אֶת כֹּחַ הַדִּבּוּר שֶׁלּוֹ, אַחֲרֵי שֶׁהִרְגִּיל אֶת נַפְשׁוֹ בְּכָל יוֹם לִכְבֹּש אֶת כֹּחַ הַדִּבּוּר שֶׁלּוֹ חָמֵשׁ אוֹ שֵׁשׁ שָׁעוֹת כָּל עֵת שִׁבְתּוֹ בְּבֵית הַמִּדְרָשׁ].
[And, in truth, it would seem to me as good counsel for one who would like to guard his mouth and his tongue from forbidden speech, to teach himself not to speak at all in the house of study or the house of prayer. For aside from this being a great mitzvah in itself because of the sanctity of the place, as the holy books write, it is also of great avail to us in other respects 1) that the Torah one studies in the house of study and his prayers be complete, not lacking any answering of "Amen" and "Amen yeheh shmer rabbah" and "Barchu", 2) that through this there be in the accounting of the days of his life about ten years free of forbidden speech. For a Jew is found during the day in the house of study for his prayers and for some time after his prayer, for at least four hours a day, especially if he also has a set time for Torah study every day in the house of study for about two hours. Attending to this, about one-fourth of the full day is spent by him in Torah and prayer. If so, how good it will be for him when a fourth part of the days of his life will be added in which there will not have been any forbidden speech, but only Torah and prayer, 3) that though through this it becomes easier for him every day, too, to guard his faculty of speech, having taught himself every day to suppress it five or six hours all the time that he sat in the house of study.]
The Yereim is 324 in the old edition, and 409 in the newer edition (printed for the first time after sefer Chofetz Chaim):
למדנו כשאמרה תורה את מקדשי תיראו שבתי כנסיות ובתי מדרשות בכלל
We have learned that when the Torah says "fear my sanctuary" that synagogues and study halls are included.
Smag positive comandment 164:
וגם בב״כ ובבתי מדרשות צריך מורא וכבוד ואין נוהגין בהן קלות ראש
Also in synagogues and study halls awe and honor are required, and one does not act in them lightheadedly.
Smak 6:
לירא מקדש דכתי' (ויקרא י״ט:ל׳) ומקדשי תיראו. ובזמן הזה הוה בית הכנסת מקדש מעט.
To fear the sanctuary, as is written "and fear my sanctuary." In these times the synagogue is a miniature sanctuary.