Let's say you had an Azelf with Skill Swap and you were facing an impostor ditto. If you used skill swap, the ditto would get levitate, and you would get impostor ability. The ditto would then turn back into a ditto, because of the loss of impostor. You would stay an Azelf though because I believe Impostor won't work in the middle of the battle. Trace would copy the impostor ability. Basically, the opponent would stay a Gardevoir or whatever pokemon you are. Hope this helps!