A KWin script implementing a feature of i3wm: Automatic back-and-forth when switching to the current workspace.
Run
kpackagetool6 --type KWin/Script --install package/
then go to "KWin Scripts" settings and enable the "Desktop auto back-and-forth" script.
Go to "Shortcuts" settings, search for "AutoBackAndForth" (under KWin) and choose your shortcuts.
Press the shortcut to switch to the virtual desktop, and press it again to switch to the previously used virtual desktop.