In view of what the Torah writes in Pasuk 6, why does it see fit to mention here that "Avimelech did not approach her"?
Rashbam: This Pasuk is actually the introduction to Pasuk 6.
What does the word "ha'Gam" come to include?
Chizkuni and Ba'al ha'Turim: Avimelech was saying that if Hashem will punish him for taking Sarah, then He must also punish Avraham, for causing him to take her.
What is "ha'Goy Gam Tzadik Taharog"?
Rashi: If Hashem would not withdraw His threat to kill him, he would arrive at the conclusion that Hashem punishes the innocent together with those who are guilty, just as He did by the generations of the Tower and of the Flood. 1
Riva: Why did you strike an entire nation (my entire household ) due to an individual (me) - and that individual is innocent!
Riva points out that according to this, the verse is out of order - it alludes to the previous generations before it refers to Avimelech!
What made him think that he was innocent?
Rashi, Seforno and Targum Yonasan: Because a. he did not sin intentionally (since he genuinely did not know that Sarah was Avraham's wife, and b. he did not even 'touch' her. That being the case, he deserved to get off scot-free.
How far did he stay from her?
Hadar Zekenim,from Bereishis Rabah 52:13: Even his slaves [who he ordered to remove her shoes and lie her down] could not get to her shoe.
רש"י: כך עשית לדור המבול ולדור הפלגה, אף אני אומר שהרגתם על לא דבר: מנין שדימה עצמו לדור המבול והפלגה?
גור אריה: "הגוי" מתייחס לאומה ולא לאדם פרטי, ולכן פירש רש"י שאבימלך אמר- אם כך אתה עושה לי [להורגני אע"פ שאני צדיק], אומר "כך עשית לדור המבול ולדור הפלגה".