If it is raining on the first night of Sukkot, Rema Orach Chayyim 639:5 writes:
לילה הראשונה צריך לאכול כזית בסוכה אף אם גשמים יורדין ויקדש בסוכה כדי שיאמר זמן על הסוכה
On the first night, one must eat a kezayit [of bread] in the sukkah, even if rain is falling. One makes kiddush in the sukkah in order to recite shehecheyanu in the sukkah.
Mishnah Berurah 639:35 quotes opinions that do not allow one to recite the blessing of leisheiv basukkah under such circumstances. He therefore advises one to wait to recite kiddush (for an hour or two, or possibly even until midnight) because:
פן יעבור הגשם דאם יעבור יכנס לסוכה ויברך ברכת לישב בסוכה ויאכל ויוצא בזה המ"ע לכו"ע
Maybe the rain will clear, and if it does, he can then go into the sukkah, make the blessing of leisheiv basukkah and eat and thus fulfill the biblical mitzvah according to all opinions.
I don't understand why one needs to wait to eat. Why can't you make kiddush in the sukkah and simply omit leisheiv? Then eat the entire meal in the house (assuming one can obviate issues with kiddush bimkom seudah). Then wait as long as you can (perhaps until midnight) for the rain to stop, in which case you return to the sukkah, recite leisheiv and eat a kezayit of bread. If the rain doesn't stop, then, before you go to sleep, simply eat a kezayit of bread in the sukkah in the rain, without leisheiv.
The advantage of this method is that this doesn't interfere with one's simchat yom tov (a concern Mishnah Berurah himself worries about in this very same paragraph.)
One issue I can see with this method is that you are reciting shehecheyanu during kiddush on the sukkah at a time when you may be exempt from the mitzvah. However, as Mishnah Berurah points out in his next paragraph:
דאפילו אם נימא דפטור אז מסוכה מ"מ יוצא בזה דלא גריע ד"ז מאלו בירך שהחיינו בחול בשעת עשייה בסוכה דיוצא בזה
Even if we say that one was exempt at that time [when he said shehecheyanu in the sukkah while it was raining on the first night], he has nevertheless fulfilled his obligtion. This is because it is no worse than had he recited shehecheyanu before yom tov when he built the sukkah, in which case one has fulfilled the obligation.