Here "his heart" refers to the whole person. A king becoming arrogant is spoken of as if his heart were lifted up. Alternate translation: "so that he does not become arrogant" or "so that he does not think he is better than his fellow Israelites" (See: [[rc://en/ta/man/translate/figs-synecdoche]] and [[rc://en/ta/man/translate/figs-metaphor]])
A king disobeying God's commands is spoken of as if a person were to turn off the correct path. This can be stated in positive form. Alternate translation: "so that he does not disobey any of the commandments" or "so that he obeys all of the commandments" (See: [[rc://en/ta/man/translate/figs-metaphor]] and [[rc://en/ta/man/translate/figs-litotes]])
Long days is a metaphor for a long life. See how you translated a similar phrase "prolong your days" in [Deuteronomy 4:26](../04/26.md). Alternate translation: "be able to live a long time" (See: [[rc://en/ta/man/translate/figs-metaphor]])