And Rav Yehuda said that Shmuel said: One who already prayed, and then enters a synagogue to find a congregation standing and praying, if he is able to introduce a new element, an expression or request, into his prayer, he may pray again, and if not, he may not pray again.
One Who Is In Doubt If One Prayed, and The Law Regarding a Voluntary [Amidah] Prayer, Containing 4 Se'ifim:
If one is in doubt if one prayed [the Amidah], one goes back and prays [the Amidah again], and one does not need to innovate anything new [in the prayer]. But if it clear to one that one prayed, one does not go back and pray [again] without an innovation [i.e. something new added to his prayer]. And by means of [using] an innovation [in one's prayer], one may return and pray as a voluntary [Amidah] as many times as one wants, except for the Musaf prayer [i.e. Amidah], for we do not pray it as a voluntary [Amidah]. And on Shabbat and Yom Tov, one may not pray a voluntary prayer at all. And if one began to pray [the Amidah], under the belief that one did not pray [already], and then [in the middle of one's prayer] remembered that one already prayed [it], one [immediately] stops, even in the middle of a blessing, even if one is able to innovate a new thing into it.
Even though there are no make-up prayers other than for the prayer immediately adjoining that prayer, and (other) prayers that one missed [i.e. one skipped two or more as mentioned above] do not have a make-up; if one wants to pray that one [i.e. the one that cannot be make-up anymore] as a voluntary prayer and one will innovate something [new] into it, one is allowed to and it is proper to do so.
[If] it was on purpose and one did not pray [an Amidah], there is no make-up for it. Even at the prayer that is immediately adjoining it. And if one wanted, one may pray it as a voluntary prayer and one does need an innovation of something new [in it] if one prayed it at the prayer time immediately adjoining it.
...
Any prayer that one adds is considered as a freewill offering. Therefore, one must add a new idea consistent with that blessing in each of the middle blessings. [However], making an addition of a new concept even in only one blessing is sufficient in order to make known that this is a voluntary prayer and not obligatory.
In the first three [blessings] and the last three [blessings], one must never add, detract or change anything at all.