From a post at DafNotes:
The Gemora states: Rabbi Nechunya ban Hakanah said that one of the meritorious acts that he performed earning him longevity was the fact that he never went to bed to go to sleep before forgiving anyone that harmed him in any manner.
The Rosh Yosef explains the reasoning for this: At night, a person's neshama ascends to the heavens to receive judgment on all the day's actions. While in heaven, the neshama, if the person merits, is able to enter into the room of Hashem and listen to hidden secrets. The Gemora in shabbos (149b) states: A person, that someone else is punished on his account, does not merit entering this private chamber. That is why it is integral to forgive anyone that harmed you before falling asleep. Rabbi Nechunya waited the entire day because he wanted to give the people that caused him harm a chance to repent on their own and to perform the mitzva of repenting.
...
In Aramaic/Hebrew, the gemara:
שאלו תלמידיו את רבי נחוניא בן הקנה במה הארכת ימים אמר להם מימי לא נתכבדתי בקלון חברי ולא עלתה על מטתי קללת חברי וותרן בממוני הייתי לא נתכבדתי בקלון חברי כי הא דרב הונא דרי מרא אכתפיה אתא רב חנא בר חנילאי וקא דרי מיניה א"ל אי רגילת דדרית במאתיך דרי ואי לא אתייקורי אנא בזילותא דידך לא ניחא לי ולא עלתה על מטתי קללת חברי כי הא דמר זוטרא כי הוה סליק לפורייה אמר שרי ליה לכל מאן דצערן
I would have simply said that this showed that while human, and thus being hurt and upset by people that aggravate him, he made sure not to bear a grudge for too long, and made his peace with them (perhaps with the declaration that Mar Zutra made). This is a positive thing to do, and seems to have little to do with entering into the room of Hashem. And does entering into this inner chamber have anything to do with longevity?
Indeed, it sounds much closer to the advice to married couples: "Don't go to bed angry!"
Or else something like "Lo siTor."
Furthermore, if "[a]t night, a person's neshama ascends to the heavens to receive judgment on all the day's actions," then shouldn't he make sure to forgive before the other person goes to sleep? It shouldn't be predicated on when he goes to sleep.
And what about that gemara in Shabbat? The gemara reads as follows:
וא"ר יעקב בריה דבת יעקב כל שחבירו נענש על ידו אין מכניסין אותו במחיצתו של הקב"ה מנלן אילימא משום דכתיב (מלכים א כב) ויאמר ה' מי יפתה את אחאב ויעל ויפול ברמות גלעד ויאמר זה בכה וזה אמר בכה ויצא הרוח ויעמוד לפני ה' ויאמר אני אפתנו וגו' ויאמר אצא והייתי רוח שקר בפי כל נביאיו ויאמר תפתה וגם תוכל צא ועשה כן ואמרינן מאי רוח א"ר יוחנן זה רוחו של נבות ומאי צא אמר רב צא ממחיצתי
R. Jacob son of Jacob's daughter also said: He through whom his neighbour is punished is not permitted to enter within the barrier [precincts] of the Holy One, blessed be He. How do we know this? Shall we say, because it is written, And the Lord said, Who shall persuade Ahab, that he may go up and fall at Ramoth-gilead? And one said on this manner; and another said on that manner. And there came forth a spirit and stood before the Lord, and said, I will persuade him. And he said, I will go forth and be a lying spirit in the mouth of all his Prophets. And he [the Lord] said, Thou shalt entice him, and shalt prevail also: go forth, and do so. Now we discussed, What spirit is meant? And R. Johanan answered: The spirit of Naboth the Jezreelite. And what does 'go forth' mean? Said Rab, Go forth from within My precincts!
In the above instance, it was already determined that Achav was going to be punished. The spirit of Navot was simply the mechanism by which to do it. It was because he was the mechanism, not the cause, that he was henceforth exiled from that precinct. And indeed, if it was because of the wrong done to Navot, that Navot had not yet forgiven {this is not established, and may not be tree}, that was the cause of Achav being punished, how could the spirit of Navot have been in the precinct of Hashem in the first place?