4דבר אחר מזמור שיר חנוכת. זה שאמר הכתוב (תהלים סב יג) ולך ה' חסד כי אתה תשלם לאיש כמעשהו. רבי יהודה ורבי נחמיה אמרי מדת פורענות עקרה ואינה עושה פירות מדה טובה עושה פירות. שנאמר (הושע י יב) זרעו לכם לצדקה קצרו לפי חסד. מה הקב"ה עושה גובה מן האדם עונותיו וחוזר ונותן לו שכרו. רבנן אמרי אפילו עונותיו אינו גובה ממנו בבת אחת שנאמר (עזרא ט יג) כי אתה אלקינו חשכת למטה מעונינו. ר' אלעזר ור' יוסי בר חנינא. ר' אלעזר אמר כף מעויין הוא כף עונות וכף זכיות. ומה הקב"ה עושה מטה כלפי חסד שנאמר (תהלים סב יג) ולך ה' חסד. ורבי יוסי בר חנינא אמר מה הקב"ה עושה חוטף שטר מן העוונות שהן בכף ומיד הזכיות מכריעות. וכן הוא אומר (מיכה ז יח) מי אל כמוך נושא עון ועובר על פשע. ר' נחמיה אומר חשב עכו"ם לעשות עבירה אף על פי שלא עשאה הקב"ה חושבה כאילו עשאה. שכן הוא אומר (דברים כו ה) ארמי אובד אבי. וכי היכן איבד לבן ליעקב. אלא על ידי שחשב לעשות כן מעלה עליו הכתוב כאילו עשאה. ואם חשב עכו"ם מצוה אינו כותבה עד שיעשנה. שנאמר (דניאל ו טו) ועד מעלי שמשא וגו'. ולא חשב לו הקב"ה עד שעשאה. וישראל שחשב לעשות עבירה ולא עשאה אין הקב"ה כותבה עד שיעשנה. שנאמר (מיכה ב א) חושבי און ופועלי רע. אמר דוד אם כן (תהלים סו יח) און אם ראיתי בלבי לא ישמע ה'. ואם חשב לעשות מצוה ונאנס ולא עשאה הקב"ה מעלה עליו כאילו עשאה. תדע לך שהרי דוד חשב לבנות המקדש ואף על פי שלא בנאו נכתב על שמו. שנאמר מזמור שיר חנוכת הבית לדוד. מכאן שכל מי שמצטער על הדבר נקרא על שמו. שכן מצינו במשה על שנצטער בתורה וישב מ' יום ומ' לילה נקרא על שמו. שנאמר (מלאכי ג כב) זכרו תורת משה עבדי. וכן דוד שנצטער עליו תחלה נקרא על שמו. שנאמר מזמור שיר חנוכת הבית:
Another thing is a Psalm for the dedication song. This is what the scripture says (Psalm 32:13): "The Lord's unfailing love surrounds the one who trusts in him." Rabbi Yehuda and Rabbi Nehemiah said that the measure of punishment is primary, and it does not yield good fruit, while the measure of good produces good fruit, as it says (Hosea 10:12): "Sow righteousness for yourselves, reap the fruit of unfailing love." What does G-d do? He collects a person's sins and then gives them their reward. The rabbis said that even if G-d does not immediately collect a person's sins, as it says (Ezra 9:13): "You, our G-d, have punished us less than our sins deserved." Rabbi Elazar and Rabbi Yosei bar Hanina said, "The hand with the scales is like the hand with sins and the hand with merits." And what does G-d do? He inclines the scales toward mercy, as it says (Psalm 32:13): "The Lord's unfailing love surrounds the one who trusts in him." Rabbi Yosei bar Hanina said, "What does G-d do? He snatches the bill of sins that is in one hand and the merits are immediately decided." As it says (Micah 7:18): "Who is a G-d like you, who pardons sin and forgives the transgression of the remnant of his inheritance?" Rabbi Nehemiah said, "If a Gentile intends to commit a transgression, even if G-d did not carry it out, He considers it as if he did it." For he says (Deuteronomy 26:5), "An Aramean tried to destroy my father." But where did Laban destroy Jacob? Rather, because he intended to do so, the scripture considers it as if he had done it. And if a non-Jew intends to perform a mitzvah, it is not written for him until he does it, as it says (Daniel 6:15), "Even until the sun rose." And the Holy One, blessed be He, did not consider it against him until he did it. And if an Israelite intends to commit a sin but does not do it, the Holy One, blessed be He, does not write it until he does it, as it says (Micah 2:1), "Woe to those who devise iniquity and work evil upon their beds." David said, "If I had seen iniquity in my heart, the Lord would not have heard me" (Psalms 66:18). And if one intends to perform a mitzvah but is prevented from doing so, the Holy One, blessed be He, considers it as if he had done it. Know that David intended to build the Temple, and even though he did not build it, it was written in his name, as it says, "A psalm, a song for the dedication of the House, by David" (Psalms 30:1). From this we learn that anyone who is distressed over a matter is called by his name, as we find with Moses, who was distressed over the Torah and is called by his name, as it says (Malachi 3:22), "Remember the Torah of Moses, My servant." Similarly, David, who was distressed over the Temple, is called by his name, as it says, "A psalm, a song for the dedication of the House, by David."