I know this has been covered by many commentators in the past, and here also, but I am still looking for a clear resolution of the ambiguities.
Who wrote the Book of Deuteronomy? Does Tradition really answer “God”? The Talmud says: Bava Batra 14b
Umi ch’tavan? -- And who are the writers [of the Scriptures]?
Moshe katav sifro, uparshat Bilaam, v’Iyyov. Yehoshua katav sifro ve-shmona f’sukim she-baTorah -- Moses wrote his book, and the portion dealing with Bilaam [in the Book of Numbers] [Num. 23-24] and the Book of Job. Joshua wrote his book and [the last] eight verses of the Torah [which deal with the death of Moses].
(1) It says, “Moses wrote his book”. What is the book that “Moses wrote”, if not Deuteronomy?
(2) Tradition says “The Torah”. But he did not write “the Torah” himself – God dictated it to him. The Talmud goes on to name the authors of all the books in the Tanach. These authors may have been "inspired", but the books were not "dictated" to them.
(3) And if it does mean that Moses wrote the Torah, why does the Talmud add “and the parts dealing with Bilaam”, since those parts are included in the Torah? The phrasing implies that "Moses' book" and "the parts dealing with Bilaam" are two different things.