The original poster contacted the VoiceAttack Discord, where they were further assisted.
The command mentioned in my posts would look something like this in the action list, when completed:
Begin Boolean Compare : [Swapped] Equals False
Press 2 key and hold for 0,05 seconds and release
Else
Press 1 key and hold for 0,05 seconds and release
End Condition
Set Boolean [Swapped] to Toggle
As with any normal logical state that exists solely within VoiceAttack itself, this would indeed get desynchronized if the ingame state is changed through other means (E.G. restarting a level).
Though, given that there are only two possible states in this particular case, executing the command twice should alleviate that.
With more complex states, a separate command could be used to adjust it to the current ingame value.