שולחן ערוך, אורח חיים רצ״ד
Shulchan Arukh, Orach Chayim 294
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.