How do Jewish scholars view the conclusion some make from the Hittite Instructions in The Ancient Near Eastern Texts Relating to the Old Testament (3rd ed. with Supplement, p. i). Pritchard, J. B. (Ed.). Princeton: Princeton University Press. (1969). These were instructions of the Hittite king to various subjects. Of course instructions from a king were more like commands than what we think of as instructions today. Some claim that God used a form similar to a king instructing his subjects, a form that Israel would understand. Of course, God's instructions are much more important than a kings'.
The Talmud describes some aspects of what happened at Mt. Sinai during the giving of the Torah in Shabbat 88a:
"The Gemara cites additional homiletic interpretations on the topic of the revelation at Sinai. The Torah says, “And Moses brought forth the people out of the camp to meet God; and they stood at the lowermost part of the mount” (Exodus 19:17). Rabbi Avdimi bar Ḥama bar Ḥasa said: the Jewish people actually stood beneath the mountain, and the verse teaches that the Holy One, Blessed be He, overturned the mountain above the Jews like a tub, and said to them: If you accept the Torah, excellent, and if not, there will be your burial."
From here we see that, yes, from the start, there was also an aspect of compulsion in keeping the Torah. At the same time, though, we know that it says in Deuteronomy 30:19:
"I call heaven and earth to witness against you this day: I have put before you life and death, blessing and curse. Choose life—if you and your offspring would live."
This is the aspect of us being given a choice, i.e., were we to want to do good, we should follow the Torah. Anything else is not good, but is equally a choice one can make.
So yes, it seems both aspects were present in the giving of the Torah and its commandments. As to whether there was done purposely by Hashem to be like certain kings of the era - I don't know. After all, the Israelites just came from centuries of servitude. I doubt the work commands they received were like instructions as though they had any choice in the matter.
This brings to mind a song by Rabbi Yehudah Halevi, author of the Kuzari:
עַבְדֵי זְמָן עַבְדֵי עֲבָדִים הֵם –
עֶבֶד ה' הוּא לְבַד חָפְשִׁי:
עַל כֵּן בְבַקֵּשׁ כָּל-אֱנוֹשׁ חֶלְקוֹ
"חֶלְקִי ה'!" אָמְרָה נַפְשִׁי.
Those enslaved to time are slaves of slaves
The servant of the Lord he alone is free
So when every man requests his due
"My due is with my Lord!" says my soul.