Recently heard the Vilna Gaon says we do 2 mitzvot while we’re sleeping, does anyone know what they are?
I have found numerous sources saying in the name of the Vilna Gaon that the mitzvot of sukkah and living in the land of Israel are done with the whole body. Some of these sources explicitly state or imply that you can do these mitzvot passively, including while you are sleeping. I have not been able to find a primary source for where the Gra said this or where someone reported that he said it. Here are some examples:
Living in Israel is a mitzvah that requires one’s entire being to be surrounded by, and like the sukkah, submerged by the holiness of the land. I believe it is the Vilna Gaon who points out one other interesting connection between these two mitzvot. Both of these mitzvot needed to be merited in order to observe them. If it is raining, one does not fulfill the mitzvah of dwelling in the sukkah and if one is forced into exile from the land, they too cannot fulfill the mitzvah of living in it.
It is said in the name of the Vilna Gaon that there are only two opportunities among all the 613 mitzvos to physically "enter the mitzvah." One is the opportunity to live in Eretz Yisrael, and the other to be in the succah you have constructed for the Festival of Succos. When you cross the border into the land of Israel, or walk into the succah, you have "entered" the mitzvah. .... Similarly, during the festival of Succos, a Jew has a chance to make every little act he does a holy act by being in the succah. Eating a celebratory meal or even sleeping in the succah is a mitzvah, a symbol of the total fulfillment of G-d's plan for the Jewish people.
The Vilna Gaon points out that the mitzvah of dwelling in the succa and the mitzvah of Tzion, dwelling in the Land of Israel, have something very special in common. When you perform these mitzvot, you enter into them with your entire being, with your entire spirit and with your entire body – even with your shoes.
The Vilna Gaon describes a remarkable connection between Sukkot and Eretz Yisrael. It is these two mitzvot alone in which we immerse fully, with our whole physical being. These two mitzvot are also unique in elevating all we do to the level of a mitzvah – for example eating, sleeping, or walking around in the sukkah, and hiking in Eretz Yisrael.
As for the point raised in one of the comments that mitzvot tzrikhot kavanah, I think you solve that issue by having proper kavanah when you begin doing the mitzvah. You do not need continuous, explicit kavanah throughout the mitzvah that you are doing a mitzvah. Furthermore, according to some poskim kavanah can be inferred from circumstances, for example if you recite a berachah before doing it, which we do in the sukkah. See Noda B’Yehudah I Y.D. 93 and Chayyei Adam 68:9. See also MB 60:10 discussing these issues.