Well, saving a copy of dovecot-uidlist file would be useful in such situation.
I added your patch to preserve dovecot-uidlist when reporting duplicate uids. Here are two examples with uidlist files attached.
Mar 14 17:59:39 server dovecot[6698]: imap(pid 80181 user user272): Warning: /Volumes/Mail/user272/dovecot-uidlist: Duplicate file entry at line 110: 1300128056.M669920P7588.server.home.domain,S=970,W=993 (uid 93 -> 193) Mar 14 18:41:41 server dovecot[6698]: imap(pid 80095 user user165): Warning: /Volumes/Mail/user165/dovecot-uidlist: Duplicate file entry at line 397: 1300132484.M237861P14283.server.home.domain,S=10873,W=11071 (uid 77 -> 409)
Also interesting would be to see if it makes a difference that uidlist is always rewritten rather than appended to.
I did not apply that patch but can if you still think it would be interesting or helpful.