The main conversion script first
generates an in-memory list of documents that must be created. It also
converts those links that need to be kept safe from
subsequent wiki-formatting of the page. Afterwards the wiki pages are
deleted. Then the script iterates through the list and creates the
pages using the original filenames.

It does need testing on more diverse zwiki-containing sites, most importantly on a copy of plone.org. I don't know if I've covered every eventuality.