Question: What are the halachot regarding someone who is saying a beracha (e.g., Asher Yatzar) and then starts hearing Kaddish or Kedusha? If she can finish before "amen yehei shmei rabba" (=aysr), should she just say the beracha quickly?
Answer: First, we must understand that there are two reasons not to speak external matters during a beracha: the disgrace to the beracha; it can render the beracha nonsensical.
Answering the main parts of Kaddish (Kadosh, Baruch k’vod) and Kedusha (aysr and amen to "…da’amiran b’alma") are so important that one stops even in the midst of a perek of Kri’at Shema or its berachot (Shulchan Aruch, Orach Chayim 66:3). This is based on the mishna (Berachot 13b) that one may respond to greetings extended by a distinguished person. Most Rishonim posit that answering these group praises of Hashem is no worse than responding nicely to a person. If this is true during Kri’at Shema and almost anything else but Shemoneh Esrei (Shulchan Aruch, OC 104:7), then Asher Yatzar is certainly not too prominent to be interrupted without it being a disgrace.
The complication is regarding making the beracha nonsensical. The Kesef Mishneh (Tefilla 10:16), in one of his explanations for an unclear phrase in the Rambam, says that one does not answer "aysr" during birchot hanehenin (on food) and birchot hamitzva. He does not say what makes these berachot special, but Acharonim (including Chayei Adam 5:13) posit that these are examples of short berachot (see Tosafot, Ketubot 7b), as opposed to the berachot of Kri’at Shema, which are long.
Actually, it is not that short berachot are more important than long ones, but that they are more likely to be "messed up" by extraneous statements. As the Ben Ish Chai (I, Shemot 6) comments, reciting "Baruch ata … melech haolam kadosh kadosh …" does not make sense. It is not like interrupting one topic to go to another and then return. Rather, it makes the opening of the beracha worthless, which is a problem when it includes Hashem’s name in beracha form. We must not do that, even for the sake of answering Kedusha or Kaddish.
In truth, the distinction is not between long and short berachot per se, but on where in a beracha one is stopping. There are no good places to stop in a short beracha. A long one has some good places and some bad ones. The Mishna Berura (51:2) discusses the second half of Baruch Sheamar (from "Baruch ata…"), which is a long beracha with a short "beracha ending" (baruch ata Hashem melech mehulal batishbachot). He rules that one cannot answer Kaddish and Kedusha from the "Hashem" until "batishbachot." Ishei Yisrael (19:4) applies the logic to the beginning of long berachot, namely from "baruch ata Hashem" until one has said a coherent idea that gives the beracha significance that allows him to interject a response to Kaddish or Kedusha. Let’s apply these concepts to Asher Yatzar. After "Baruch … asher yatzar et haadam b’chochma," (one could argue, until "…chalulim") the beracha is significant, and one can answer until Hashem’s name at the beracha’s end.
What about stopping in the middle of a phrase in the midst of a long beracha? The Shulchan Aruch (OC 66:3) rules that one stops for Kaddish and Kedusha even in the middle of a pasuk of Kri’at Shema. There is a machloket whether this is only at a coherent stopping point in the pasuk (see Mishna Berura 66:10). While he urges planning, to avoid this situation, the Mishna Berura allows stopping anywhere but says that after answering, he should return to the beginning of the pasuk. So too, it is proper to be at a good place in mid-beracha to pause to answer, but if necessary, one can answer in the middle of a long beracha and then return to a place that makes the continuation coherent.
Finishing up quickly is fine if you can say the beracha with sufficient kavana. However, if you finish the beracha at the same time you need to answer amen, you should not say amen (other than to aysr) because it looks like you are saying amen to your own beracha (see Mishna Berura 51:3).
285 - Unintentional and Innocuous Deceit
286 - Answering Devarim Shebekedusha During One’s Beracha
287 - Reliability Regarding Kashrut