have a look at the Cleanup Dialog Quality -> Cleanup. It already has some builtin formatter you can configure for all fields or only some. It works on all selected entries.
Have you had any trouble with this? I have been trying to format Journaltitle for multiple entries, but whenever I click Cleanup Entries, it cleans only the first entry if I’ve selected a bunch. If I select 3 or 4, it works fine.