Mirror Device Behavior in Routines Running Locally

You have to check the state of the mirror device before blindly sending it a command. For example:

Switch B is off (pre-condition state check)
  If Switch A turns on 
     then turn on Switch B

Switch A is off (pre-condition state check)
  If Switch B turns on 
    then turn on Switch B

and, of course, you need two corresponding Routines for the opposite state on each switch.

You can also use the Aplicaciones Virtuales Mc Edge driver from @Mariano_Colmenarejo which has a mirroring function that can be used in Routines.