There are many situations where one is in the midst of fulfilling one mitzva, when another mitzva then presents itself. For example, in the middle of prayer, someone asks for charity. Does one have to fulfill the second mitzva, or is he exempt on account of being involved in the fulfillment of the first? Thanks for your very clear and detailed answers.
There is indeed a general principle that one’s being engaged in the performance of a mitzva exempts one from needing to fulfill another mitzva that comes his way.
The reasoning behind this is as follows: If one who is idle shuns the performance of a mitzva it would be tantamount to denying G‑d and His commandments. However, one who is actively engaged in performing G‑d’s will certainly can’t be viewed as denying G‑d and the mitzvot by continuing to perform that mitzva even though it’s the cause of declining from fulfilling another.
However, based on this reasoning, there are several exceptions and qualifications.
If the mitzva that he’s currently engaged in can be done at a later time without diminishing it, and the other mitzva that presents itself can only be done now, and afterward it will no longer be applicable, one should temporarily postpone his observance of the first in order to fulfill the other. In this way he fulfills both mitzvot as opposed to just one. And refraining from fulfilling the second mitzva in this case is somewhat like disregarding the mitzvot since doing so would be choosing to do one mitzva when he could have done two.
Similarly, even if both mitzvot are time-limited and must be done now or never, but the person can actually do both simultaneously, he must not shun the later mitzva because of his previous involvement in the former. And this is because his engagement in the first mitzva is not so engaging as to preclude his ability to concurrently perform the other. The example you give would fit this category since most people in most parts of prayer can give charity during prayer without distracting their intention. Exceptions to this would be during the first part of Shema or during the Amida. Since here one needs utmost intention, it would be forbidden to interrupt for charity.
Thus, only in a situation where one could not perform both mitzvot, neither at different times nor at the same time, would one’s involvement in the one exempt him from the other. And in most cases, the mitzva that he is already engaged in takes precedence over the other, even if the other is a “greater” mitzva (except in a case of monetary loss or physical danger). But if one has not begun the performance of either, and both are presented simultaneously, the more “important” mitzva takes precedence. An example would be when a Torah mitzva conflicts with a Rabbinic mitzva and only one of them can be fulfilled to the exclusion of the other, the Torah mitzva takes precedence.
One notable exception to this is the otherwise all-important mitzva of Torah study, where even if one is currently engaged in this prime mitzva, he must suspend his learning in order to fulfill even the “least significant” of mitzvot.
The reason for this is that since the main purpose of Torah study is to learn how to perform G‑d’s commandments, that same Torah study cannot be used as a basis to exempt one from its practice. On the contrary, one’s very Torah study requires one to interrupt his studies in order to practice what he learns!
That being said, there is an important qualification to this exception of suspending Torah study in order to fulfill another mitzva which will pass if he continues to learn without fulfilling it. And that is when the mitzva can be done only by him and no one else. For example, regarding his own mitzva of prayer or tefillin which are limited in time and are incumbent solely on him. But if the mitzva can be performed equally well by someone else who is not currently studying, here the primacy of Torah study over other mitzvot takes precedence and he must continue studying and leave the performance of the mitzva to others.