As he and the others trekked across the wasteland, he had plenty of time to think over his budding plan to save his friends. It could happen. It really could. He just needed to convince WICKED of two things—insert him into the maze, and do it without erasing his memories. For any kind of plan to work, he had to have his mind intact. Only then would he know how to get them out.
There were details to figure out. How, when, and where to get weapons. How to shut down the Grievers. Where to go if they did somehow escape the WICKED complex. But he had time.
It really could work.