Possible but difficult
You would have to find someone in the other state who wanted to swap. This is conceivable but difficult if you want the houses to be the same value. How do you find the one person who lives in the right place now and wants to move to the right area?
The normal way
The normal way this situation is handled is to simply put your house on the market. At the same time, you find a new house in the new location. You arrange for a new mortgage for the new house and make purchase contingent on selling the old house. Your buyer pays off your mortgage and gives you a bit left over that you use as a downpayment on the new house.
Note that you take a loss on closing costs when you do this. This is why if you are in the position where you move frequently, you may be better off renting.
Sometimes an employer will help with this, paying for a long term hotel or short term rental. This can give you more room to sell and buy the houses.
An alternative
If you have to move right now, immediately, not in a few months when your housing situation is fixed, consider double renting. You rent out your mortgaged house to someone and pay rent on a new place. You may put some of your stuff in storage until you get into your permanent place.
The downside is that it can be harder to sell a house with a tenant until you are close to the end of the lease. And of course, you are probably not in the best position to get or pay good rent. Your situation restricts your options. You might get stuck in this situation for a year so as to get the time that you need to line up a buyer.
Of course, you may get lucky and find someone who wants your old house as an investment property. Such a person won't be bothered by a tenant. But they usually want a good price. After all, they want to make money off it.
We buy ugly houses
There are those operations that advertise that they buy ugly houses. They want a good deal. You'll probably take a bath. But they can buy quickly, so you can move on quickly. No waiting until they find a buyer.
Swapping
And I'm not saying that you can't do a swap like you want. I'm just saying that you may find it difficult to find a swapping partner. Perhaps an investment person would be up for it. They take your house in trade for their house, letting you stay in their house until they can fix up your old house and either rent it or sell it. The problem is that it may be hard to find such an investor who can handle a house where you are and has a house where you need to be.
I don't have a good suggestion for finding a swapping partner other than calling a lot of realtors and asking for suggestions. Maybe a bit of online checking for properties where the owner's business is managing the sale.