Refactor first
Engineering has to draw the line somewhere. Excuse my analogy, but if the order is "you are not allowed to clean up the construction site, only build", and there's so much crap around that it's no longer safe, then the answer is, "no, I can't work like this, find someone else to do it"
That said, there is an art to working in and managing tech debt. The amazing thing about software is how flexible and how twisted it can get behind the external interface
Depends how much it matters. See if you can get the business to put it in dollar value terms or at least as opportunity costs against other eng work.
Would be sort of a spike project, but would be interested to see how well off-the-shelf VLMs could handle screenshot comparisons, and then a bit extra to see how to deploy them efficiently and effectively.