I use this lease calculator when trying to figure out the details of a lease offer and compare them side by side to other deals.
http://www.ridewithg.com/calculator/index.html
If my memory serves me correctly, any amount put towards a lease (trade in, down payment, cap cost reduction) are all taken off of the negotiated price of the car. Then the lease payments are calculated from there. Because the residual is calculated on a percentage, it's not as straight forward as taking 20g's off the leased amount. Very basically, I would look at it like this...
(Assumes 36 months, 12k/yr, 3% sales tax)
Vehicle Price: $50,000
Residual: 58%
Money Factor: .00125
Payment: $702.54
Buyout: $29k
Now add your trade in, same assumptions:
Vehicle Price: $30,000
Residual: 58%
Money Factor: .00125
Payment: $104.50
Buyout: $29k
Huh, interesting. That's not behaving like I thought. I stand corrected (or the calculator is wrong).
I would have expected to see a payment of about $421 and a buyout of $17,400 after your trade-in. Hmmm.