Just use a temporary variable:
swap[a_List, p_, q_] := Module[{aa = a}, aa[[{p, q}]] = aa[[{q, p}]]; aa] swap[{1, 2, 3, 4}, 1, 2] {2, 1, 3, 4}
Actually I just remembered there is a built-in for this: Permute with Cycles
Permute[{1, 2, 3, 4}, Cycles[{{1, 2}}]] {2, 1, 3, 4}
Also ReplacePart is rather clean:
swap[a_, p_Integer, q_Integer] := ReplacePart[a, {p -> a[[q]], q -> a[[p]]}]