What is the significance of the fact that Yitzchak had been living in Gerar a long time?
Rashi and Rashbam: Seeing as time had passed and they had not stolen Rivkah from him, he thought that he no longer needed to be careful, and he left a window open, via which Avimelech saw them being intimate. 1
Hadar Zekenim: After much time of avoiding intimacy due to danger, his love for her intensified.
Oznayim la'Torah: Avimelech still had an eye on Rivkah and kept watch 2 on them to ascertain whether they were really brother and sister as they claimed - waiting for an opportunity such as this to catch them acting as man and wife.
Malbim: This shows HaSh-m's protection over him, that Rivkah was not taken. Also, after she was established to be his sister, Avimelech could have killed him for having Bi'ah with her (a Ben Noach is killed through one witness and one judge)! 3
Ha'amek Davar: His stay was long in the eyes of the leaders of the city, who resented Yitzchak staying in the capital city.
See Sifsei Chachamim.
As the word "va'Yashkef" implies.
Surely, Avimelech did not kill everyone who transgressed one of the seven Mitzvos of Bnei Noach. Presumably, also he was an idolater (Avraham was punished greatly for making a Bris with him - Bereishis Rabah 54:4)! Perhaps Yitzchak had already prospered, and they envied him, and would use any pretext to kill him. Or, Avimelech was still angry that he (or his father) needed to give money to Yitzchak's mother (refer to 20:16:2:5). (PF)
How could Avimelech see them being intimate? One may not have Bi'ah during the day!
Hadar Zekenim (#1): After much time of avoiding intimacy, his love for her overpowered. 1
Hadar Zekenim (#2), Ohr ha'Chayim #1: He was intimate, but not through Bi'ah. Ha'amek Davar - "Es Rivkah Ishto" teaches that he sported with her like with a wife; surely, she was not his sister!
Hadar Zekenim (#3), Moshav Zekenim, Chizkuni: In a dark room it is permitted (Nidah 17a), i.e. he closes the window. 2 Avimelech inferred from the closed window that they were being intimate.
Lev Eliyahu (Bereishis p. 90, based on the Vilna Gaon and Zohar): (It was at night.) Just like an Ish Kadosh can see hidden things through Merkavah ha'Kedoshah, one can see hidden things through a Chalon (window) of Merkavah ha'Temei'ah.
Ohr ha'Chayim #2: There are Heterim for the sake of Refu'ah, or if one's desire was aroused [and he fears lest he have an emission], like we find in Kesuvos 65a.
Riva, Gur Aryeh: A Talmid Chacham may darken [i.e. block the light] with his cloak (Nidah 17a).
Moshav Zekenim: Some say that this is a Heter, like we find regarding Yirmeyahu's father (Bereishis Rabah Sof 64:5. He had Bi'ah with his wife during the day before fleeing Izevel, who was killing Nevi'im. Yefe To'ar - In that case, he did not have children yet, or there is a Mitzvah of intimacy before one goes away.) This Midrash holds that Yirmeyah was more than 250 years old when he first had Nevu'ah, and yet he called himself a Na'ar (Yirmeyah 1:6)! (PF)
Alternatively, he closed the window at night, and Avimelech inferred (Moshav Zekenim).
How could they be intimate? One may not have relations at a time of famine! We can ask similarly about Levi; Yocheved was conceived in the years of famine (Rashi to 46:15).
Hadar Zekenim #1, Riva #1, Gur Aryeh (to 41:50): Some Tana'im permit [even] for one who has two sons (one does not fulfill "Peru u'Revu" (1:28) without a daughter). 1
Hadar Zekenim #2, Riva #2: It is permitted on the night she immerses [after being Nidah].
Hadar Zekenim #3: The Isur applies only to a famine of known duration, like the seven years in Egypt. 2
Hadar Zekenim #4, Riva #3: The Isur applies only to a famine in the entire world, like that of Egypt.
Moshav Zekenim: There were no other Yisraelim there. Yitzchak had food. Should he refrain due to Nochrim?!
One who has not yet fulfilled the Mitzvah of "Peru u'Revu" (1:28) may have relations even during a famine (Ta'anis 11a). According to Beis Hillel, the Mitzvah to procreate is fulfilled by having both a son and a daughter (Yevamos 62b). According to the Midrash, Yitzchak and Rivkah did not have any more children after Yaakov and Esav, i.e. they did not yet have a daughter. (CS)
This answer (and the answers that it is only for a world famine, or that there were no other Yisraelim) do not help for Levi! Below (41:50), he cites R. Yehudah ha'Chasid that the Isur is only for a Navi who knows that there will be a famine. (However, Ta'anis 11a forbids Stam, i.e. for any famine, and not only a Navi! - PF)
QUESTIONS ON RASHI
Rashi writes: "He saw him engaged in relations." How do we know this; perhaps he merely saw other types of affection?