“and Moses drew near to the thick darkness where God was.” This is Moses’ fourth time up Mount Sinai. God had spoken the Ten Commandments directly to Israel from the top of Mount Sinai after Moses went down for the third time (Exod. 19:25). God’s loud voice, combined with the dark cloud, fire, thunder, and shofar blast, had frightened the Israelites and they asked that God not speak to them again (Exod. 20:18-19; cp. Deut. 5:22-27). So Moses went back up to God and got more laws for Israel to live by (Exod. 21-23). Those initial laws were called “The Book of the Covenant” (Exod. 24:7), and they, along with the Ten Commandments, were the laws that Israel agreed to obey when they made the Old Covenant (cp. Exod. 24:3-8).
[For more on Moses’ seven trips up Mount Sinai, see commentary on Exod. 19:3.]