In order to 'swap' properties you would each have to go through the correct conveyancing process and actually sell your homes to each other and buy each other's homes in return. Why?
Ownership of heritable property (land and buildings) cannot be transferred solely by private contractual agreement - it must be registered in the land register. Only on registration at the land registry does ownership transfer.
And, as sunbabe has mentioned, if you have a loan secured on the property by granting the lender a standard security, (the Scots equivalent of a 'mortgage') the lender has a right in that property, and will continue to have a right in that property until the point where the debt is discharged.
Even if each have no loans secured against their respective properties it could be a problem. Suppose Alf and Bert agree to swap houses and Bert becomes bankrupt at some point in future. Bert would still own the house he sold to Alf, but a creditor of Bert's could take Alf's home - because it is still owned by Bert.
If Bert dies, his home (registered/owned to Alf), cannot pass to bert's successors - he does not not own it, so the right to it cannot pass.
So, don't swap! Buy/Sell through your own solicitors (by law you have to), and get it all done properly.