Re: The code was well structured but ...
> His replacement found it easier to rewrite the code from scratch rather than attempt to figure out what it actually did.
Been there. Done that. My manager asked me to evaluate some data migration code written by *her* boss, involving Microsoft Access .mde files and a database with a single table, where the columns were Data1 through Data75. Looked at that database, looked at the code (VBA, naturally), tried to figure it out, and went back to my boss and said that the code was beyond hope and should be rewritten.
It turned out that her boss had been embezzling - those migrations were supposed to have been contracted out, and he was pocketing the cash and writing the stuff himself.