If one forgot to insert "Ya’aleh V’yavo" in the Amidah of Hol HaMoed, he must go back and repeat the Amidah. However, if he remembered in the subsequent Berachot, he just goes back to the Beracha of "Re’seh" and inserts it there. If he didn’t remember until he already said the phrase "Y’hyu L’rason Imreh Fi" immediately before "Oseh Shalom," for all intents and purposes he has already finished the Amidah and must repeat it from the beginning.
Some have the custom not to proceed directly to the "Oseh Shalom" after "Y’hyu L’rason Imreh Fi" but add additional prayers and supplications, such as the well-known "Tefilat Rav," with its fifteen prayers for "Haim"-life. After that, they add an additional "Y’hyu L’rason." If he remembered "Ya’aleh V’yavo" at that point, it is considered that he is still in the middle of the Amidah and only goes back to "Re’seh." Once he recites the final "Y’hyu L’rason Imreh Fi," he must return to the beginning of the Amidah.