The idiom ‘out of the blue’ is used to talk about something that happens all of a sudden whereas ‘given the green light’ means to be permitted to do something. Hence, the correct answer is ‘He was imagining his friends enjoying themselves at the lake when he heard footsteps at his door out of the blue!’