If your $(which mv) version supports -b then the code below is ok, otherwise edit the function with alternative temporary file strategy.
# define alias fswap
alias fswap='function _fswap () { mv -b ${1} ${2} && mv ${2}~ ${1}; }; _fswap'
# usage
fswap file1 file2