An agreement is an agreement - if you have emails or chat messages or so on, that's already a contract.
They have a choice - give you something handwritten now or they lose their developer at the point where they are about to close a deal, which is a really bad time. They will tell you that this is the wrong time to apply pressure, but for you, this is exactly the right time. This is when they are most vulnerable because the deal could fall through, so this is your best chance to get this through.
When they have investment, how useful do you think you will be? They will just get rid of you and hire someone new.
Maybe this points to the root of the communication problem between you and them. By threatening, instead of doing what an assertive person might do (which might be to simply walk away with the code that you own and wait for them to contact you with a sweet offer in writing), you might be sending them a message that is poisoning the negotiations. It is possible to be passively abusive to people. It might be your own greed and anxiety that is preventing you from being a stand-up person, doing the stand-up thing, and making money off of this situation.
Things will happen fast then. Otherwise, you just go get another job. You have nothing to lose that you have not already lost, they have everything to lose. You have them by the balls, don't let them intimidate you.