It seems a shame that a developer should have to jump through hoops to protect their hard work.
Personally, I would seek legal advice if I felt I had been unfairly treated, as from what you have said, it isn't just the code the client could keep. but it looks like they owe you payment.