A Wonderful Test Suggested by the Divrei Yechezkel
I learned this second method of discerning the true nature of a mitzvah from the teachings of the distinguished Rabbi of Shinaveh, zy”a, in Divrei Yechezkel (Shemos). He comments on the Midrash (S.R. 1, 32) related to the passuk (Shemos 2, 19): “They replied, ‘An Egyptian man saved us from the shepherds.’” Yisro’s daughters said to Moshe: "'יישר כוחך' (well done or thanks) for saving us from the shepherds.” Moshe said to them: “That Egyptian whom I killed, he saved you.” Hence, they said to their father, “An Egyptian man saved us.” In other words, who caused this one to come to us? The Egyptian man whom he killed. What message did Moshe Rabeinu intend to convey by telling them that it was the Egyptian whom he killed that saved them?
He explains that a person occasionally does something that at the time seems to be a mitzvah. Subsequently, however, he has doubts and starts to question whether in reality it was a mitzvah or alternatively an aveirah. To resolve this dilemma, he need only look at the consequences of his actions. If it led to a positive result, it indicates that the original deed was a mitzvah, in keeping with the teaching: "מצוה גוררת מצוה". If, however, it led to a negative, undesirable result, it indicates that the original deed was an aveirah and not a mitzvah, in keeping with the teaching: "עבירה גוררת עבירה".
This was the dilemma experienced by Moshe Rabeinu. Although he killed the Egyptian l’shem shamayim, nevertheless his conscience bothered him—perhaps it was wrong to take a human life. But when he saw that as a result of killing the Egyptian, he ended up saving the daughters of Yisro, he realized that he did a righteous, justified deed. Furthermore, he was privileged to save many more lives, proving the veracity of the truism: "מצוה גוררת מצוה".
Additionally, what the distinguished Rabbi of Shinaveh, zy”a, explains based on this notion in relation to the passuk (Bereishis 50, 12) is brought down in Divrei Yechezkel HaChadash (Addendum to Vayechi): "ויעשו בניו לו כן כאשר צום"—his sons did for him exactly as he had instructed them. He interprets this passuk as a question and an answer. “His sons did for Him” inquires how can we know if the actions of His sons, referring to the children of HKB”H, were done l’shem shamayim. The answer is: “Exactly as He instructed them”—if the deed resulted in a mitzvah that Hashem had commanded them, it is clear that the deed was also a mitzvah.
The distinguished Rabbi of Shinaveh, zy”a, once presented this notion at his holy Friday night Shabbas table when the people in attendance pushed so enthusiastically that they accidentally extinguished the candles on the Shabbas table. He commented that this proved that the pushing was not l’shem shamayim. For, if it had been l’shem shamayim, it would not have resulted in an aveirah.