Deut 31:2

31:2 120 years old. Acts 7:30 tells us that Moses had spent forty years in Midian tending sheep. This time was not wasted, as he learned the geography and climate of the Sinai peninsula in preparation for leading the Israelites in that area for another forty years. The humiliation of being reduced from a prince in Egypt to being a hired tender of sheep also accomplished the divine disciplinary purpose of preparing Moses for his greater role as shepherd of God’s people. This leaves forty years for Moses’ youth and training in Egypt. So God ensured that Moses was prepared for his great task.

no longer able to go out and come in. A reference to limitations on Moses’ daily activities as leader of the vast company of Israelites (28:6 note). The statement in 34:7 that Moses’ “eye was undimmed, and his vigor unabated” need not mean that he felt no effects of his advanced age. Moses’ many-faceted role as Israel’s leader was coming to an end.