After reading countless ending interpretations from twitter and reddit and mdl, this is the one that actually made the most sense. It's a combination of various people's interpretation.
Ziqi (yes his real name is Ziqi in the modern world based on the medical records) actually transmigrated to the book during his surgery after he made his wish. That's probably why Miaomiao got pulled in at the same time because of his 2nd wish to let Miaomiao know of his hidden feelings. Unlike Miaomiao, he didn't have his modern world consciousness, but all throughout we saw hints that he was from the real world - swing, snow, shadow.
Ziqi regained his full modern world consciousness when he had the talk with his younger selves. That's when he realized he was actually the author, being actually the author, currently under surgery. That's why when he confessed to Miaomiao of being Fu Zhou on top of that stairs, we get the flashback of his decision of finally doing the surgery after reminiscing their high school days because he finally remembered. That's why he confessed all his books were written for her because he finally remembered.
And that's why when Miaomiao woke up (and Ziqi woke up from his surgery), the novel got rewritten to have a happy ending. Because Ziqi experienced everything Miaomiao experienced and is no longer afraid of endings. He actually remembered their whole experience, otherwise why would he randomly rewrite his first novel (the only answer is he now has a reason to after the ordeal he went through with Miaomiao).
That's why the foreword contained the lines of 100%, in reference to Miaomiao's quest, because Ziqi actually saw the 99% formed by the dust demons in the mountains. He had been stuck at 99% for a while so he must have wondered because he probably thought he had already loved Miaomiao so much so why did it only turn 100% at the end, so the acknowledgement in his rewritten novel was in reference to that because he finally found his answer.
And that's why on their meeting on the book signing conference, he called her Miaomiao affectionately when he hasn't seen Miaomiao in years (presumably ever since Miaomiao transferred schools). If he hadn't transmigrated, he would have called her by her full name - Ling Miaomiao. But he said it exactly the same way book Ziqi said it, which is the last evidence that his memories from his time as book Ziqi is intact.
So pre-surgery Ziqi made his three wishes, and he and Miaomiao got pulled into the novel at the same time. Miaomiao had her modern world consciousness. Ziqi didn't at first, but he regained it in the end. When they both woke up, they have their memories intact. Miaomiao's is hazy at first, but she will remember/already remembers based on that smile at the end. And of course Ziqi remembers, as written above.
A complete full circle and a very happy ending ㅠㅠ Okay I'm off to rewatch the last episode with this in mind ㅠㅠ