As this one hasn't panned out as you had hoped, you might want to consider evaluating how you approach your next contract. Rather than cross your fingers and sign up for 6 months, you might suggest to the company that they bring you on for 12-40 hours of evaluation work. Offer a reduced rate or even to do that work for free, if needed. At the end of that contract, you will provide them with your professional opinion of what it would take to complete the work they are expecting for the full contract. Break it down into schedule and price, present it to them so they can see what you're offering and how you'll be worth it. Price that contract accordingly. If you want the work, emphasize how you are now the most familiar candidtate with the work to be completed. If you don't want the work, finish your presentation explaining how you feel that as a professional, you can't in good conscience accept their contract because they would be throwing good money after bad, but would be more than happy to help them find someone who can.
This approach will tell you several things:
- The health of the code you're about to become responsible for.
- If the company balks at the idea of paying for you to evaluate their code, let that be a warning as to how willing they'll be to pay for "real" work. If their management can't get this straight, expect that they will also jerk you around with their specifications and last-minute changes.
- If their code is an unholy mess, you can decline to bid for the followup work, or at least bid at a rate that makes it worth it to you to slog through it. Declining the work in a professional way, like "I think you will be better served by finding someone else to complete the work; can I refer someone to you?" is miles above taking on the work and then quitting or doing a piss-poor job of it.,
Don't worry about them never hiring you again. If the relationship is going to sour, it's better for both parties to know that up front rather than invest 6 months of time into it.