Yes, I know there is a whole sefer in front of us, sefer Devarim, but that is Mishneh Torah. We should still consider the first four sefarim as a unit, such that we should expect some closure to the Torah.
That, I think, is peshat in the instruction to Moshe about fighting Midyan, in parashat Matot:
|ב נְקֹם, נִקְמַת בְּנֵי יִשְׂרָאֵל, מֵאֵת, הַמִּדְיָנִים; אַחַר, תֵּאָסֵף אֶל-עַמֶּיךָ.||2 'Avenge the children of Israel of the Midianites; afterward shalt thou be gathered unto thy people.'|
There are plenty of explanations, on the level of both peshat and derash, for the linkage. But one can regard this not just as Moshe's final act as leader, but as a closure to the Torah as well.
Given the confusing events, perhaps out of order, in sefer Shemos and sefer Bemidbar, it is useful to have an index or table of contents to mentally place them in order, and to give a brief overview. This, too, is an effective way of ending the sefer. Since we might think that this is the work of a separate author, who processed it for us, we have this introduction:
Isn't everything in the Torah from Moshe Rabbenu by the commandment of Hashem? Why specifically here are we informed that Moshe wrote it by Hashem's command? Indeed, this is presumably what leads Ibn Ezra to suggest that the goings-forth are al pi Hashem, rather than the vayichtov being al pi Hashem. And what leads Ramban to cite Rambam in Moreh Nevuchim for a reason, specifically, for writing it based on Hashem's command.
But looking at it from the this perspective of closure of the sefer / of the Torah, this is telling us that this, too, was written by Moshe. Perhaps one could say it was a separate document which Yehoshua tacked on, with pesukim 1 and 2 written by Yehoshua by way of introduction (similar to the last 12 pesukim of the Torah, according to Ibn Ezra). Or perhaps these two introductory pesukim, as well, written by Moshe. Regardless, this demonstrates a belief / importance in the Torah in general being written by Moshe Rabbenu mipi Hashem, and that this is more than just an assumption by later generations. Yes, there is the pasuk in Devarim 31:9:
|ט וַיִּכְתֹּב מֹשֶׁה, אֶת-הַתּוֹרָה הַזֹּאת, וַיִּתְּנָהּ אֶל-הַכֹּהֲנִים בְּנֵי לֵוִי, הַנֹּשְׂאִים אֶת-אֲרוֹן בְּרִית ה; וְאֶל-כָּל-זִקְנֵי, יִשְׂרָאֵל.||9 And Moses wrote this law, and delivered it unto the priests the sons of Levi, that bore the ark of the covenant of the LORD, and unto all the elders of Israel.|
but the extent of 'this law' is interpretable. But this pasuk in Masei, I think, shows that this was the expectation even as it was written.
Other aspects of Masei -- meaning the laws related in Arvot Moav from 33:50 until the end -- relating to driving out the current inhabitants of Canaan, inheritance, borders, which nasi from each shevet shall take possession of the land, cities for Leviim, cities of refuge, and practical rather than theoretical inheritance relating to the daughters of Tzelaphchad, all make for a nice closure to the sefer and the Torah in general, and it may pay to view them in this light.