Shulchan Aruch, OC 236:3: If someone discovered a group that had already read [the evening] "Sh'ma" and is about to say amida [of maariv], then he should say amida with them and then say "Sh'ma" ...
What are you supposed to do after interrupting Shemoneh 'Esreh? Do you start over? Continue where you left off? Assume that the interruption was either permitted, or if it was forbidden it was ...