Siman 93
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א יִשְׁהֶה שָׁעָה אַחַת קֹדֶם שֶׁיָּקוּם לְהִתְפַּלֵּל, כְּדֵי שֶׁיְּכַוֵּן לִבּוֹ לַמָּקוֹם; וְשָׁעָה אַחַת אַחַר הַתְּפִלָּה, שֶׁלֹּא תְּהֵא נִרְאֵית עָלָיו כְּמַשּׂאוֹי שֶׁמְּמַהֵר לָצֵאת מִמֶּנָּה.
1 Before One Prays, One Needs to Wait: containing 4 s'ifim. One should wait one [halakhic] hour before he rises to pray [the Amidah] in order to focus his heart to the Omnipresent. And [one should wait] one [halakhic] hour after the prayer, so that it should not seem like a burden to him, that he is quick to leave it.
ב לֹא יַעֲמֹד לְהִתְפַּלֵּל אֶלָּא בְּאֵימָה וְהַכְנָעָה, לֹא מִתּוֹךְ שְׂחוֹק וְקַלּוּת רֹאשׁ וּדְבָרִים בְּטֵלִים וְלֹא מִתּוֹךְ כַּעַס, אֶלָּא מִתּוֹךְ שִׂמְחָה כְּגוֹן: דִּבְרֵי תַּנְחוּמִין שֶׁל תּוֹרָה סָמוּךְ לִגְאֻלַּת מִצְרַיִם אוֹ סָמוּךְ לִתְהִלָּה לְדָוִד שֶׁכָּתוּב בּוֹ: רְצוֹן יְרֵאָיו יַעֲשֶׂה, שׁוֹמֵר ה' אֶת כָּל אֹהֲבָיו (תְּהִלִּים קמה יט כ).
2 One should stand to pray with reverence and humility and not in the midst of laughter, frivolity or purposeless matters, and not in the midst of anger. Rather [he should pray] in the midst of joy, like the words of comfort from the Torah, for example those that follow the redemption from Egypt [i.e. the blessing after the Recitation of the Sh'ma] or that follow Tehila l'David [i.e. Psalm 145], where it is written in it "He will do the will of those who revere Him" [and] "Hashem guards all those who love Him." [Psalms 145:19-20].
ג אֵין עוֹמְדִים לְהִתְפַּלֵּל מִתּוֹךְ דִּין, וְלֹא מִתּוֹךְ הֲלָכָה שֶׁלֹּא יְהֵא לִבּוֹ טָרוּד בָּהּ, אֶלָּא מִתּוֹךְ הֲלָכָה פְּסוּקָה. הַגָּה: וְהַיְנוּ נָמֵי כְּמוֹ מִתּוֹךְ שִׂמְחָה, כִּי פִּקּוּדֵי ה' יְשָׁרִים מְשַׁמְּחֵי לֵב (תְּהִלִּים יט, ט) (טוּר).
3 We do not stand to pray in the midst of (ie. immediately after) judging a case, or in the midst of [studying] Jewish law, so that one's heart will not be troubled with it (ie. he will be distracted by it), rather [we stand to pray] in the midst of [studying] conclusive Jewish law. Rema: For this is also like being in the "midst of joy", because of [the verse] "the precepts of Hashem are upright, delighting the heart" [Psalms 19:9] (Tur, Orach Chaim 93:1)
ד הָעוֹסֵק בְּצָרְכֵי צִבּוּר כְּעוֹסֵק בַּתּוֹרָה דָּמִי, פֵּרוּשׁ: לְעִנְיַן לַעֲמֹד מִתּוֹכוֹ לְהִתְפַּלֵּל, שֶׁגַּם זוֹ שִׂמְחָה הִיא לוֹ שֶׁעוֹסֵק בְּצָרְכֵי צִבּוּר. וְיֵשׁ מְפָרְשִׁים דְּהַיְנוּ לְעִנְיָן דְּאֵינוֹ צָרִיךְ לִפְסֹק לְהִתְפַּלֵּל.
4 One who is engaged in communal needs is like someone who is engaged in Torah, meaning, in regards to standing in midst of it to pray, that it too is a joy for the one who is engaged in communal needs. And there are those who explain that this [comparison] means that one does not need to interrupt [serving communal needs in order] to pray.