I do not see a problem in Ex 31:17. YHWH (the LORD) is speaking personally and using personal pronouns. All the personal pronouns (I, me, etc) refer to YHWH.
However, when God directly quotes the fourth commandment, He quotes it verbatim. Since that(slightly paraphrases) the text from Ex 20:11 which uses a third person pronoun, it is quoted verbatim. Therefore, if I were offering my orthography of Ex 31:16, 17, I would punctuate it as follows:
Therefore the people of Israel shall keep the Sabbath, observing the Sabbath throughout their generations, as a covenant forever. It is a sign forever between me and the people of Israel that, "in six days the LORD made heaven and earth, and on the seventh day he rested and was refreshed."