AKA: Holy Shit, Mulder's Off The Spaceship
Although it seems in retrospect that Duchovny's return to The X-Files was as inevitable as the tides, when the Season Seven finale was written, they were trying to thread the needle of creating an exit that would let them bring back Mulder if they could reach an agreement with Duchovny while also keeping him away without having to explain too much if the agreement fell through. But when they managed to get Duchovny secured, they all knew they couldn't keep giving him cameos and flashbacks forever; Eventually they'd have to figure out how to bring him back to the main plot.