The End of Time
The scene in which Missy is tied to a chair on board the plane was written as a parallel to the Master tying the Doctor to a chair in "The End of Time".