Heisenbug: can't delete user without post in rapid succession of deleting users without posts

It’s an import issue from MyBB. The search by email feature in MyBB is crappy and finds nothing for, for example, “freemail.hu”. I ran an import a few months ago, and even though since I’ve cleaned up more of the MyBB userbase, running the import again preserves users imported back then. In the meantime there has been activity in the Staff category, so I can’t wipe out the DB and import from scratch.

I’d be happy if there were a utility script I could tweak, that allowed simple batch operations on users, such as deleting users if their email matches a given domain.