Some thoughts...
Well, in the original storyline (series) Princess Celestia predicted everything regarding NMM's escape. I personally think that it was her idea to bring Luna back. The Stars, the Main6 heroes, the NMM's actions... Celestia knew everything what will happen and how will things end. She knew that she will be captured, but she also knew that she will be freed when Main6 wielding the Elements will defeat NMM.
She had to wait for a perfect night for this to happen. Heroes to assemble, etc. Otherwise it wasn't possible to bring Luna back.
She probably created that book, that Twilight studied.
In my opinion, Celestia and NMM arranged a deal. Well, at least they had big plans for this Summer Sun Celebration. They did had different targets.
Celestia wanted to bring Luna back, while NMM wanted to rule Equestria in the eternal night.
Celestia was at least one step further. NMM captured her easily. She probably haven't even fought back knowing, that the Elements will do their job. NMM's plans failed quickly.
^ Two messages I sent to BronyCray connected. I'm very interested how will he end the story.