A quick proof to address the following: https://www.reddit.com/r/i3wm/comments/6dnzol/workspace_auto_back_and_forth_yes_but_to_same/
To use it, run the shell script in the background (you can add it to your i3 config for example) - it will detect back and forth actions and swap the monitor workspaces as appropriate.
Requirements:
- pipenv
- python3