Locked are locked. So if anything is to happen to them, the user would need to unlock them first. I had to do that recently and temporarily rolled back the VAT returns and unlocked them in order to edit some old invoices because they were connected to the wrong nominal codes. So when the user comes to delete, you can do a quick check to see if any transactions are locked and then throw up a message to let them know that you can’t proceed because of them.
Ask the user what they want done? If they don’t want anything done, then you have the current default behaviour which is to leave the balancing entry in place but in an unpaid state. Otherwise, delete the balancing entry. In my case, I would like for all the balancing entries to be deleted as I am now going through deleting the 9,000 there (which is even more painful than deleting the 9,000 bank transactions because deleting invoices doesn’t refresh the list like it does with banking).