Switching A -> Preview -> A should be treated as no change.
Switching A -> Preview -> B should be treated as A -> B, this may or may not be seen as a change.
Maybe mode switching itself should never be an undo command. Operatopns inside modes are, and Undo/Redo can switch mode automatically based on the current position in the Undo stack.