The conclusion of Shabbat, much like the conclusion of many other Mesechtot, contains a contextualizing and corrective message.
The text reads:
עוּלָּא אִיקְּלַע לְבֵי רֵישׁ גָּלוּתָא. חַזְיֵיהּ לְרַבָּה בַּר רַב הוּנָא דְּיָתֵיב בְּאַוּוֹנָא דְמַיָּא וְקָא מָשַׁח לֵיהּ. אֲמַר לֵיהּ: אֵימַר דְּאָמְרִי רַבָּנַן מְדִידָה דְמִצְוָה, דְּלָאו מִצְוָה מִי אֲמוּר? אֲמַר לֵיהּ: מִתְעַסֵּק בְּעָלְמָא אֲנָא.
Rabba bar Rav Huna is spending his Shabbat bathing in the house of the Exilarch. This itself is unusual for several reasons. The Exilarch’s house is a place where Shabbat observance was lax (see Shabbat 48a, 55a). In addition he is sitting in a tub of water, which Rabbi Meir has prohibited one to do on Shabbat. And the commentary of Ben Yehoyada points out, onlookers might think the water was hot, which would be impermissible according to all opinions. And then he is measuring, which in ordinary circumstances is prohibited because of its secular or business like nature.
Ulla is surprised by his colleague's actions. But the answer Rabba bar Rav Huna offers opens a window of understanding into what Shabbat ultimately is about. He says that he is merely מִתְעַסֵּק, having some absent minded fun. However, the language of מִתְעַסֵּק is usually a technical term, a category that exempts a person from an action which is completely unintentional; and it hints a much larger perspective.
The meaning of this answer, is that what is considered labor on Shabbat is to a large extent defined by intent rather than by action. After an entire Mesechet which discusses what actions are prohibited, we must again reflect on the mental aspect of Shabbat. The Talmud has emphasized that beyond the technical Halakhic rules of melacha/work, there are categories of weekday-like labors that are restricted as well. But this second type of labor is certainly in the eye of the beholder. Running around the field with a trash picker picking up garbage is labor; running around the same field with a golf club hitting a ball is leisure. Play can resemble work, and may even require some work; but we don’t want to squelch moments of relaxation, even if they seem "not Shabbat-like". Too harsh a halakhic regime would undermine the enjoyment of Shabbat; and those moments of Shabbat enjoyment allow us to celebrate God’s creation and man’s inherent freedom. Because the experience of Shabbat is in many ways subjective, we must find a way for Shabbat to engage hearts and minds. The laws of Shabbat have to find a careful balance, to avoid weekday type labor on one hand, without preventing one's ability to enjoy the day; and Rabba bar Rav Huna sits right at the fault-line between these two values, and reminds us that even a rabbi can celebrate Shabbat by sitting in the bath.