Religious traditions place him in approximately the middle of the 2nd millenium BC, while secular scholarship, when they assume he even existed, put him in the 13th century BC. There are numerous scholarly sources attesting to the fact that Hebrew only began to exist as a language in about the 10th century BC. Ergo, Moses must have written in a pre-Hebrew language, which would have very likely been Ugaritic, or at least a related dialect.
This is backed up by the fact that there are certain portions of the Old Testament that are written in a form of Hebrew which is comparatively archaic, such as the Song of Moses in Deuteronomy and the middle chunk of the Book of Job. You can see this reflected in the 2nd century BC Greek translation, the Septuagint, wherein various chunks of these texts are skipped, apparently on account of the translators being unsure how to translate what would be comparable to Middle English to us.
Where did you get the bit about the Torah originally being written in Ugaritic? What scholarly sources say that?