Yep, that's exactly how it works, but keep it mind...my trade was $650 for a $650 phone so it's a wash. BUT they instead of putting me in a contract free plan owning my device they lock me in with 24 months worth of credits.
Buy giving them $650 now (not trade) I'd be +$650 on them. So if I ported out they'd owe me $650 in a check, period. That requires I have $650 though to pay it off.
In the the case that say you give a trade for less than the total for new phone amount. The same would occur, but again...if my trade was $300 for a $650 phone and I paid off the $650 they would only owe me back the $300 credit because I'd owe them the $350 difference.
That's why it's a rarity. Most people don't trade in a device of equal value. So yeah my situation is slightly different.