Not sure what you're having trouble understanding. You explained it all prefectly in your first post.
You owed 31k. You said you're upside down at that amount. How much? 1k or 10k? Doesn't matter technically. It will cost the dealer 31k to buy (payoff) your trailer. That's a fixed amount. The difference between that and what it's actually worth on trade is your discount off Msrp.
Good deal? Maybe, maybe not. That's the one number you left out.
However, remember, dealers are there to "help" people who cannot manage or understand their own financial situations. They're not going to go do a 3 way deal out of the kindness of their hearts.
Their goal is to make money off every deal (just like our own goals would be with our professions, go to work to make money). Some deals are more lucrative than others for them and it's going to cost the customer more if the dealer has to utilize their own capital to bail out a customer.