I tend to agree with your thoughts but I would add this: If the cofounder is shutting one entity and starting another to do essentially the same thing, you don't want a piece of that pie. Count yourself lucky that all that happened is that the company failed and go to the next thing. If he's willing to do that, he's got next to zero character.
As for the code, I wouldn't touch it after the original company ceases. The code belongs to the entity that created it and when its gone, the code is gone. If you start something new from this code and it becomes successful, guess who is going to come out of the woodwork and want a portion of it? Yes, the same guy who likely would deny you anything from his new venture.
I've been in this situation and when you've written so much code, and it's good. It's painful to separate from it. I also flip houses and there are times when it's time to just sell the house already and I almost feel sad that I'm not going to get to work on it anymore. Sometimes I feel remorseful that I won't get to see all my good work after its sold. But here's the thing, if I don't sell it, I won't replenish the capital I need to do more. And in the software sense, if I don't move on from a project after its done, I will continue to mentally and physically labor on a work that is producing nothing. And if it does do something, you'll forever be looking over your shoulder for that cofounder who will sue you for a portion of it.
All this said, there are a couple of alternatives you can consider.
#1 is to simply agree with the founder that the company should open source the code base. This gives you the benefit of letting future employers, cofounders, coworkers, etc seeing your work. And this benefits him too as being associated with the project. it puts a coda on the project so that the work you did doesn't just disappear into vapor.
# 2 you should consider both signing separation agreements and put it in writing that everything is over and there are no claims on work product, intellectual property, etc.