No payment would invalidate the license.
What about partial payment? What about a payment dispute? in all these cases ownership remains as defined in the contract.
You could try to make a contract that works the way you describe but it would be unwieldy and I’m skeptical anyone would use it.
It’s really straightforward to call a collections lawyer. In most cases the money is paid after one or two letters.
Not paying money owed can have bad consequences. The collections lawyer reminds them of this, and the situation is remedied in short order.
On the other hand, pulling some cowboy stunt to teach them a lesson (like releasing their source code, or the related idiotic idea of sabotaging their website or business) could lead to paying significant civil and even criminal penalties.
Generally speaking the client owns the code whether or not they've paid yet. Of course if the client agrees this is fine. But it's not fine if the client hasn't agreed.
Stunts like this are a really bad idea. There's a right way to do it, and it works really well. Call a collections lawyer.