If it were me in this situation, I would leave the ugly-but-working code intact to handle current processing. I would then study it thoroughly to determine the original specs of the project. I would then reverse-engineer a ground-up rewrite of the code using those specs.
That way, you're not constrained by any legacy code conventions and can do it your way right from the start. You have the added advantage of a more relaxed time-frame, since the current code is still working in the production environment.
---
It's all fine and dandy until someone has to look at the code.