dnd 5e – In the Lost Mine of Phandelver adventure, when does Flameskull attack?

Note: I am French, and although I am fluent in English, I am sometimes baffled by a phrase.

In P. 46, under room 12 ("Smelter Cavern"), he says that Flameskull's orders are to prevent anyone from passing through the room he defends.

Does that mean that Flameskull only attacks if you try to cross the room?

If someone takes a couple of steps and then back down the same corridor they entered due to the zombies, would that trigger the flameskull or not?