ANSWER: Moses did not write the Ten Commandments on the tables of stone - God did.
Exodus 34:28 says, "So he [Moses] was there with the LORD forty days and forty nights, he neither ate bread nor drank water. And He wrote on the tables the words of the covenant, the Ten Commandments." It appears the "he wrote" could refer to Moses. The difficulty in understanding this account is purely grammatical.
From Deuteronomy 10 it can be absolutely proved that God wrote the Ten Commandments mentioned in Exodus 34:28. Deuteronomy 10:1-4 states: "At that time the LORD said to me, 'Hew for yourself two tablets of stone like the first, and come up to Me on the mountain and make yourself an ark of wood. And I will write on the tables the words that were on the first tablets, which you broke; and you shall put them in the ark.' So I made an ark of acacia wood, hewed two tablets of stone like the first, and went up the mountain, having the two tablets in my hand. And He [God] wrote on the tablets according to the first writing, the Ten Commandments, which the LORD had spoken to you in the mountain from the midst of the fire in the day of the assembly; and the LORD gave them to me."
Exodus 32:16 tells us the first tablets were also the work of God. "Now the tablets were the work of God, and the writing was the writing of God engraved on the tables." Additional proof is found in Exodus 31:16 "And when He [God] had made an end of speaking with him on Mount Sinai, He gave Moses two tablets of the Testimony, tablets of stone, written with the finger of God."