You responded, "$4100"
Reviewing all the options, I wish I could give you a clear cut solution.
As it sets, the Terrain has very little, if any value. By replacing the transmission, based upon the description you've given the vehicle, you gain more value within the Terrain, than what you put into it. Logically, one would suggest you go through with the replacement of the transmission, even if you were to sell it immediately -- let alone if you were to continue driving it.
I hate to suggest this, but do you have an independent mechanic in your area that you know and can trust? It may be worth getting a second opinion on the vehicle knowing it is outside of warranty coverage.