The used car manager probably called a wholesaler or two in your area and asked for bids on your truck. On old, rough, high mileage units like your Dodge the dealership can't get them financed for another buyer so they will only allow whatever price figure his used truck wholesaler put on it. A wholesaler probably offered $1500. That figure is known in the industry as ACV (actual cash value). Dealers can't sell an old truck like that and, as you indicated, they would have had to have the transmission rebuilt and body rust repaired, a paintjob, etc. Can you really blame them?
When my current '08 arrived at the dealer 13 months ago diesel fuel prices were extremely high and diesel truck sales were very poor. I had a very nice, very clean, very well maintained '06 3500 DRW SLT quad cab in perfect shape to sell. It needed nothing. It even had a year old full DTT full billet transmission in it. However, it was a transporter truck with 230,000 miles on the odometer. I shopped it around and quickly realized I couldn't give it away except to a cash buyer at a discounted price.
I called my dealer where I always buy and asked him to get me a couple of wholesale bids on it. He did and allowed me the highest figure he could get. When I drove it in to pickup my new truck they called the wholesaler and he came over with a check and drove it away. There was no way the dealership could get financing for an '06 Dodge with 230,000 miles so they didn't want it on the lot. Somebody got a hell of a good truck. I took what I could get out of it and moved on.