I've done something similar - but without the evil
I learned early on that most customers are reasonable, honest people. I also learned that a minority... aren't.
One thing that a friend who sold hardware taught me early on was to add the line "Title and ownership transferred only upon receipt of final payment". He learned that the hard way when a customer went bankrupt. All of the customer's assets, including those my friend had sold to him, were liquidated at 15 cents on the dollar. Fortunately, it only resulted in something like a $300 loss, but it could have been a lot worse. From then on, by explicitly retaining ownership until payment was complete, hardware sold to later customers that went bankrupt could be recovered without going through the receiver or liquidator.
Software and licenced intellectual property are a little more difficult to repossess, however.
So, I always programmed a expiry date in any custom application I wrote for customers. It wasn't for blackmail purposes; after final payment was made, the date check was removed in the final build. But if the customer decided to renege on that payment, and/or pass along a copy to other users in violation of the contract terms (and a few have), they'd eventually see a popup that stated "The software licence for this software has expired. To extend or purchase a licence, please contact XYZ at 416-xxx-yyyy".
I had a few shady customers basically laugh in my face when I presented the final invoice and tell me to go fornicate myself, because they had the code deployed and "there isn't a damned thing you [sic] can do about it". And they weren't all fly by night operators, by any means. A couple were in the Fortune 100.
When dealing with a Schedule A bank with billions in assets, it's a lot easier to get them to pay their bills when not doing so affects their business.
I will always cherish the look on the face of the MegaBankCorp lawyer who was initially full of bluster when the private banking side of the bank had sicced him on me for "sabotaging" their customers with my logic bomb. The lawyer was in full bore "sue you into the ground" mode. But when I asked him to provide proof of payment, the bank - the bank - financial person at the meeting said "umm, actually, we haven't been able to find any cheques or money transfers, but we're sure we paid him", his face went white. The finance guy showed the first two payments via money transfer just fine, but the third one, the biggest one, had no record of being paid. Then he said "oh, we must have paid him in cash, and forgotten to ask for a receipt". He paused, and asked the lawyer if that was a problem. The lawyer just looked at him, and in an absolute deadpan voice said "big time".
And just like that the problem went away. When I invoiced them for my time with their lawyer, they paid without even challenging it. As a lawyer friend put it, "suing people for not doing work they haven't been paid for is rarely a successful argument in court"