The Flighty Customer
R. Chaninah b. Akavia states that a sofer stam, a scribe involved in writing a Sefer Torah, tefillin, or mezuzos, as well as merchants (wholesale and retail) involved in selling these items, are exempt from Shema, tefillah, teffilin, and all other mitzvos while working (based on the rule that one engaged in a mitzvah is exempt from fulfilling another mitzvah at the same time).
The Magen Avraham (Orach Chayim 38:8) infers from the words of Rashi (s.v. “Tagareihen”) that only a merchant who distributes tefillin and mezuzos (primarily) for the sake of heaven (with no regard for profit) – i.e., he wants to make them available to people who cannot otherwise obtain them – is considered to be “involved in a mitzvah.” Someone whose primary reason for selling these items is to earn a living is not considered “involved in a mitzvah” and is not exempt from other mitzvos while on the job.
The Scribe And The Merchant
Bi’ur Halacha (Mishnah Berurah, Orach Chayyim ad loc. s.v. “Hem vet’agareihem”) draws a distinction between those who write tefillin and mezuzos and those who sell them. Writing tefillin and mezuzos is an actual mitzvah, for the Torah explicitly states, “You shall write them…,” whereas selling them is not an explicit commandment; it is just something that is necessary to facilitate a mitzvah (a hechsher mitzva – a preparatory mitzvah act). Thus, Bi’ur Halacha suggests that although selling tefillin for monetary gain diminishes the mitzvah significance of the act, writing tefillin is always considered a mitzvah act, even if the sofer’s primary intent is to earn a living (see also Responsa Chasam Sofer, Sha’ar HaTosafos, siman 15).
I’ve Got A Plane To Catch
The Levush (cited by Mishnah Berurah, Orach Chayim ad loc., s.k. 26) maintains that a sofer or a tefillin merchant is exempt from Shema and tefillah only when there is a customer on hand who absolutely cannot wait for his tefillin (today, such a customer would say that his flight is about to leave…). Only in such a case, where the need is immediate, is the merchant or sofer permitted to attend to his customer and forgo Shema. However, under normal circumstances a sofer may not forgo Shema and tefillah merely because he is occupied with his customers.