Siman 294
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 The Laws Governing the Recitation of Havdalah in the Shemoneh Esreh, 5 Seifim: We say Havdalah in "He who grants wisdom", and if one erred and did not say Havdalah, he continues his prayers and does not return, since he needs to say havdalah on a cup [of wine]. And if he ate prior to saying havdalah on the cup, he must pray again and recite havdalah in the prayer.
ב טָעָה וְלֹא הִבְדִּיל בַּתְּפִלָּה, וְאֵין לוֹ כּוֹס בַּלַּיְלָה וְסָבוּר שֶׁאַף לְמָחָר לֹא יִהְיֶה לוֹ, צָרִיךְ לַחֲזֹר וּלְהִתְפַּלֵּל.
2 If one erred and did not say Havdalah in Shmoneh Esrei, and he does not have a cup at night and he believes that even tomorrow he will not have one, must return and pray again.
ג תִּשְׁעָה בְּאָב שֶׁחָל לִהְיוֹת בְּאֶחָד בְּשַׁבָּת, טָעָה וְלֹא הִבְדִּיל בַּתְּפִלָּה אֵינוֹ צָרִיךְ לַחֲזֹר וּלְהִתְפַּלֵּל, כֵּיוָן שֶׁמַּבְדִּיל עַל הַכּוֹס בְּמוֹצָאֵי תִּשְׁעָה בְּאָב.
3 If one erred and did not mention Havdalah in the Evening Shemoneh Esreh when Tishah BeAv falls on the day after Shabbos, it is not necessary for him to repeat Shmoneh Esrei, because he will say Havdalah over a cup at the conclusion of Tisha B'Av.
ד בְּמָקוֹם שֶׁאָמְרוּ שֶׁאֵינוֹ חוֹזֵר לְהִתְפַּלֵּל, מִיָּד כְּשֶׁסִיֵּם הַבְּרָכָה אֵין לוֹ לַחֲזֹר, אַף עַל פִּי שֶׁלֹּא פָּתַח בַּבְּרָכָה שֶׁלְּאַחֲרֶיהָ.
4 In a situation where we say one does not go back and repeat Shmoneh Esrei immediately when one finishes the blessing, one does not go back even though he did not begin the following blessing.
ה בְּמָקוֹם שֶׁאָמְרוּ שֶׁאֵינוֹ חוֹזֵר, אִם רָצָה לְהַחְמִיר עַל עַצְמוֹ לַחֲזֹר אִם סִיֵּם תְּפִלָּתוֹ, רַשַּׁאי. אֲבָל אִם עֲדַיִן לֹא סִיֵּם תְּפִלָּתוֹ, אֵינוֹ רַשַּׁאי לַחֲזֹר.
5 In a situation where we say one does not go back, if one wants to be strict on himself to go back, if he finished his Shmoneh Esrei it is allowed. However, if he had not yet finished the Shmoneh Esrei he is not allowed to go back and repeat.