Why does it say "Amarti Ani b'Libi"?
Ibn Ezra: I was astounded - how can there be evil in the world, Hashem's deed? I knew that Hashem will judge them? (justice will be done).
Rashbam: I thought to say that Hashem judges Tzadikim, just like He judges Resha'im. Tzadikim have a minority of sins, and due to them they are deposed from their place, and Resha'im come in place of them. Ri Kara - We find like this when the 10 tribes sinned. Sancheriv exiled them, and put Shomeronim in place of them. Hashem collects from Tzadikim for a minority of sins. All the more so He will collect from Resha'im! If Tzadikim were exiled for a few sins, all the more so Resha'im will be eradicated for many sins!
Bereishis Rabah (34:10) says that a Tzadik speaks El Libo, and a Rasha speaks b'Libo. Koheles said b'Libo (2:1, 15, here and the coming verse), and also Avraham did (Bereishis 17:17)!
Refer to 2:1:1:1-3 and the note there.
What is the Chidush that Hashem will judge Tzadik and Rasha?
Rav Sadya Gaon: He has a assemblage in which he will judge the Tzadik and the Rasha.
Rashi: In the end, Hashem will judge everything. Even though it is delayed, it will come; there is a time for everything, even for punishment and judgment.
Ibn Ezra: Refer to 3:17:1:1.
Seforno: He will judge Yisrael and the nations.
Metzudas David: Here it discusses a Tzadik who sits there (in the place of Mishpat) and is enticed after the Rasha's mindset. He and the Rasha who enticed him will be punished equally.
What is the meaning of "Ki Es l'Chol Chefetz v'Al Kol Ma'aseh Sham"?
Rav Sadya Gaon, Rid: Hashem has a time designated [to judge] every matter and creation there. Ibn Ezra (7:3) - this is the Emes; - "Ki Ein Ma'aseh v'Cheshbon" (9:10) is what people say.
Rashi: Refer to 3:17:3:2.
Rashbam: There is a time for Hashem to fulfill every desire of His.
Seforno, Metzudas David: He will judge the Chefetz (bad intent) in addition to the act. Therefore, also the pursued will be punished for bad intents that they were not able to carry out due to lack of ability.
What is "Sham"?
Rashi At that time, every deed will be judged. If a goat fled, and the shepherd cannot chase it, he will rebuke it at the gate of the pen, and lash it in the pen 1 .
Ibn Ezra: Sham hints to the world to come, just like "v'Arum Ashuv Shamah" (Iyov 1:21) hints to the grave. If it hints to returning to the earth from which he was taken (Bereishis 3:19), also here it means after death.
Rashbam: He will be judged where he sinned. It is Hevel that Tzadik and Rasha are judged together.
Shabbos 32a: So a woman giving birth is prone to be punished for previous sins.