Throughout the eight days of Hanukah, one is required to add the section of Al Ha’nisim in every Amida prayer. Al Ha’nisim is added in the Modim section of the Amida, before the words "Ve’al Kulam."
There is some discussion as to whether one should recite "Al Ha’nisim" or "Ve’al Ha’nisim." According to Halacha, it is more proper to recite "Ve’al Ha’nisim," with the conjunction "Ve" ("and"), since this sentence continues the text of Modim. In the Modim section, we declare that we thank Hashem for all the wondrous acts of kindness which He performs for us, and we then add that we thank Him as well for the miracles He performed at the time of Hashmona’im. It is therefore proper to recite "Ve’al Ha’nisim," rather than "Al Ha’nisim."
If a person forgot to recite Al Ha’nisim, and he realized his mistake before he said Hashem’s Name in the concluding Beracha ("Baruch Ata Hashem Ha’tob Shimcha…"), then he should recite at that point, "Modim Anahnu Lach Al Ha’nisim…" and then continue as usual. If he did not realize his mistake until after he recited Hashem’s Name, then he simply continues with the Amida. He should not recite Al Ha’nisim after the Beracha, before "Sim Shalom," as this would constitute an unwarranted interruption in the Amida. Preferably, one who forgot to add Al Ha’nisim should recite, "Modim Anahnu Lach Al Ha’nisim…" at the very end of the Amida, before reciting "Oseh Shalom."
If a person forgot to recite Al Ha’nisim during the Amida, and then, mistakenly thinking that he must repeat the Amida, began reciting the Amida again until he realized that he should not repeat the Amida, he must stop immediately. Any subsequent Beracha that he recites is a Beracha Le’batala (Beracha recited in vain), and he must therefore stop wherever he is and not even complete the Beracha which he currently recites.
If a person mistakenly recited Al Ha’nisim in the section of Reseh, in the place where Ya’aleh Ve’yabo is recited on Rosh Hodesh and festivals, and he realizes his mistake during the Modim section, then he should simply recite Al Ha’nisim as usual in Modim. His prayer is valid despite the fact that he made an unwarranted interruption by reciting Al Ha’nisim in Reseh.
A person should not skip Al Ha’nisim for the purpose of completing the Amida in time to recite Nakdishach or Kaddish with the congregation. One might have thought that since the Amida is valid even if one forgot to add Al Ha’nisim, it is preferable to skip the prayer in order to be able to join the congregation for Nakdishach or Kaddish. In truth, however, one should recite Al Ha’nisim as the Sages enacted, even at the expense of joining in the recitation of Nakdishach or Kaddish.
Summary: One must add Al Ha’nisim in the Modim section of every Amida prayer recited throughout the eight days of Hanukah. If one forgot to add Al Ha’nisim and realized his mistake only after reciting Hashem’s Name in the concluding Beracha of Modim, he simply continues reciting the Amida, and does not repeat the prayer. Preferably, he should add Al Ha’nisim before "Oseh Shalom" at the very end of the Amida.