I once lead a project that had simularities with this.
The record was a single source file 18,000 lines long, of which 15,000 was in a single procedure.
The company was frightened of that code so were worried about us touching it. So at one point I quietly took 3 days to refactor it into some kind of sensible shape. Actually that was not so dificult, as always apply the 80/20 rule to contro, what is worth doing. By going for the easy hits first you can quite quickly remove a lot of the fear.
The trickiest parts were global variables with names like NicksSpecial some of which were used to pass values all over the place while others had multiple different purposes due to having reached the environments limit on global variables.
Still it was different to the linked project in other ways. The product was selling well and being extended into new business areas we also had a dedicated development team of 3 that grew to 5.