This 動く means 行動する (to act, to behave). I think, in this case, it means like "to do what you have to do".
Act (= Do what you have to do) imaging the situation at the time the fire spreads.
(火事になったときの状況を想像して動きなさい (= するべきことをしなさい)。)
I hope thos was helpful.