Based on what you've said here, unfortunately you won't be able to trade in the device. It has to be in resalable condition for T-Mobile to honor the trade-in.
You can trade it in but T-Mobile will zero the value and keep it just the same. Your better bet would be to get it unlocked and see what you can get for it on Swappa. From your description, it probably won't be worth a lot. The charging port not working is a value-killer all by itself. Probably best to keep it as a spare, IMHO.