In reading the Mishnah Berurah commentary in several places in the exact chapter that you cited, it seems quite obvious that one may not talk when he hears Kaddish being recited. It makes no difference if he is praying with the minyan or even if he is in a nearby room, whene her hears Kaddish. he must respond Yehi Shmei Rabbah.
Summary of major points, all coming from Mishna Bereurah commentary on OC 56:
א - says that one must be careful not to speak at all when Kaddish is said and concentrate and say with all his might Yehi Shemei Rabbah
Rama"h at end of par. 1 says that someone who arrives late (which means, he is not part of the current service, now. He will be once he begins his own davening.) must respond to whatever part of the Kaddish that the cong. is saying even if he hasn't heard its beginning.
Mishnah Berurah ו - says that in a place where there are 2 minyanim next to each other, if he hears both say Kaddish as a single voice, he responds to both of them. True, he is responding to the one he is in, but, at the same time, he is responding to the one that he is NOT part of, as well.
The point is, that it seems clear that responding to Kaddish is paramount.
What I've mentioned addresses specifically answering Kaddish. It is a given, that one should not be talking in shul while davening occurs, whether he is part of the current minyan or not, irrespective of Kaddish.