The ability holder will switch between its Shield Forme and its Blade Forme depending on the move it is using. The ability holder will transform into its Blade Forme when it uses a damaging attack, but can only turn back to its Shield Forme if it uses King's Shield. Other status moves will keep the current Forme active. Even moves like Sleep Talk activating an attack move or King's Shield will not trigger a Forme change.
The Ability activates prior to and independently of any checks for status conditions that may stop the user's attack, such as sleep or confusion.