Yes, there are a lot of factors to consider... Because this is an investment property (and not your primary residence) you may end up with a tax liability if you do a Deed in Lieu or Short Sale. I believe the amount you are "forgiven" would be reported on a 1099 to the IRS and you would have to include it as "ordinary" income. So if you're in a 20% tax bracket with a $100k forgiveness of debt you might owe $20k to the IRS. If this were your primary residence you would not have any tax liability per a recent change in tax law. I'm not a CPA (just a mere Realtor) so I would recommend verifying this with an expert.
How much would you owe verus how much it would you net if you sold it? Do you have any other assets or have you had a decrease in income since purchasing the townhouse? If you do not have any equity in the townhouse, the lender may work out a loan modification to reduce your interest rate. The underlying investor may not want to take it back, either, unless they have a Credit Default Insurance from AIG (owned by us taxpayers, now!) that will fully reimburse them for their loss. If so, they may have no incentive to modify your mortgage.
Hope this helps.
All my best,
Alma Rose Kee, P.A.
Charles Rutenberg Realty, Inc.