Emergency islanding of a microgrid (MG) can be vital in ensuring continuity of power supply to a local network during major contingencies in the main grid. However, such an event will inadvertently cause large voltage transients except in the trivial case where zero power is exchanged. The under/over voltages can result in the disconnection of the local distributed generators within the MG, increasing the risk of a local blackout. In this paper, we present a MG operational optimization strategy that includes dynamic voltage constraints aiming at enhancing MG resilience during emergency situations. A dynamic optimization technique, based on sequential constraint transcription, is used to formulate the dynamic voltage security constraints applied to the steady-state problem in a computationally efficient manner. An iterative approach ensures that the dynamic constraints are updated in relation to the optimized operating point of the MG. The performance of the proposed approach is investigated on a 30-bus medium-voltage MG by considering a potential disconnection at each hour of the day, subject to daily load and generation profiles.