I am in a similar situation renting a condo up in the LA area, but my landlord is not yet in as much trouble as it sounds like yours is. The HOA on my unit is also $500+.
I remember in a previous discussion powayseller recommending this organization for those of you in SD:
You may also want to check out http://www.freeadvice.com, which is a site where you can get free legal advice. Be advised though that many of the contributors to this site appear to have the perspective of owners, so you may not get all the information that you need there.
I would be careful withholding rent or counting your deposit in place of payment. Unfortunately if your owner declares bankruptcy I think you have to get in line with the other creditors to recover your security deposit. I believe you can sue in small claims court for it, however. Next time if I rent from an individual owner I may try and get the security deposit held in an escrow account, hopefully protecting it from situations like this.