Mishlei 6:23 says כִּי נֵר מִצְוָה וְתוֹרָה אוֹר. By the Mitzva it first says Ner and then Mitzva, however by the Torah it first says Torah and then Or. Why is there a change in the order, why not כִּי מִצְוָה נֵר וְתוֹרָה אוֹר or כִּי נֵר מִצְוָה וְאוֹר תוֹרָה?
This type of poetic symmetry is common in many places where "song" is used in Tana"ch. It is esp. common where nouns and verbs are used, but it is not unique to such construct (I.e. it could be noun / adjective). I'll use an example from the end of Mishlei as you should be familiar with these verses:
אֵֽשֶׁת־חַ֭יִל מִ֣י יִמְצָ֑א וְרָחֹ֖ק מִפְּנִינִ֣ים מִכְרָֽהּ׃ בָּ֣טַח בָּ֭הּ לֵ֣ב בַּעְלָ֑הּ וְ֝שָׁלָ֗ל לֹ֣א יֶחְסָֽר׃
A woman of valour who can find? For her price is far above rubies. The heart of her husband doth safely trust in her, and he hath no lack of gain.
אֵֽשֶׁת־חַ֭יִל מִ֣י יִמְצָ֑א - noun followed by verb
וְרָחֹ֖ק מִפְּנִינִ֣ים מִכְרָֽהּ׃ - adjective (prep. phrase?) followed by noun
("Symmetrical" - noun at beginning; noun at the end)
בָּ֣טַח בָּ֭הּ לֵ֣ב בַּעְלָ֑הּ - verb followed by noun (object)
וְ֝שָׁלָ֗ל לֹ֣א יֶחְסָֽר׃ - noun followed by verb
(Symmetrical - starts with verb, ends with verb)
You also see this type of parallelism in the Torah even if not associated with a "song". Example:
וְהֵסִ֧יר יְהוָ֛ה מִמְּךָ֖ כָּל־חֹ֑לִי וְכָל־מַדְוֵי֩ מִצְרַ֨יִם הָרָעִ֜ים אֲשֶׁ֣ר יָדַ֗עְתָּ לֹ֤א יְשִׂימָם֙ בָּ֔ךְ וּנְתָנָ֖ם בְּכָל־שֹׂנְאֶֽיךָ׃
And G-d will remove from you, all sickness; and all of the evil diseases of Egypt, which you know, He will not place on you but will give them upon all those that hate you.
Verse begins with a verb followed by the object (noun). 2nd half of verse begins with the object (noun) and the verb follows it.
The answer lies in the cantillation. That is, the vowels of the words drive the cantillation, and thus the word order (and verse parsing).
The books of Tihillim (Psalms), Mishlei (Proverbs), and Iyov (Job) were cantillated to music and therefore had carried a different priority of cantillation marks than the other twenty-one books of Scripture. In this regard, this particular verse appears in the Masoretic Text with the following disjunctive and conjunctive cantillation marks.
The Masoretic Text therefore helps to understand why the verse appears in this particular grammatical order. That is, the cantillation in Biblical Hebrew stems from the vowel points of the words set with particular disjunctive and/or conjunctive cantillation marks, and therefore also provides the logical understanding in reverse cascade order. The following diagram provides the schematic logical understanding of the verse in reverse cascade order (please click to enlarge).
The disjunctive accent marks "set off" the major breaking points between the logical segments of the verse. Subsequent (stronger) disjunctive cantillation marks will "accent" the previous (less powerful) disjunctive cantillation marks. In this regard, the following expanded English translation will convey the logical idea based on this musical cantillation structure.
Mishlei (Proverbs) 6:23
23 For the commandment is a lamp; that is, Torah is light.
What is meant by this phrase is that the way of life comes through the reproofs of discipline.
Before closing, what would have been wrong with the following, which would have made more sense and would have aligned with the remainder of the verse?
First, the Masorah Gedolah of the Tiberian Masoretic Text indicates that there are 20 places in Mishlei (Proverbs) where the initial word כִּי carries the initial conjunctive accent of the verse. This initial accentuation therefore forces the M'huppakh conjunctive accent to appear (since this part of the verse is dominated by the Atnach disjunctive accent). In other words, this first accented word of the verse (כִּי) is what will drive how the clause is accented.
Second, M'huppakh conjunctive accent is terminated by Dechi disjuntive accent, which closes the clause (and the logical thought). In other words, when the Atnach-dominated clause contains three or more words, the Dechi accent appears as the subordinate disjunctive accent.
Third, and most importantly, the Hebrew word נֵר is one syllable-long, and therefore is too short to take the Dechi disjunctive accent, and so the rules of cantillation and accents had forced the swap of the placement of the words נֵר and מִצְוָה. Thus the correct arrangement of the words in this verse appears as follows in the Masoretic Text.
In summary, the division and order of words and phrases within the verses of Scripture were not only musical, but also logical (and were driven by words, their vowels, and their respective placement in the verse). This hybrid of logical and musical arrangement of words and verses not only helps to understand and clarify Scripture, but also enables memorization, since both the logical and musical arrangement appear through the very same cantillation marks.
Hebrew Cantillations (2014). Bellingham: Lexham Press.
Weil, Gerard E. (2001). Massorah Gedolah: Manuscrit B. 19a de Léningrad. Rome: Pontificium Institutum Biblicum.
Wickes, William (1887). Two Treatises on the Accentuation of the Old Testament. Oxford: Clarendon Press.