Do you have a source for the $/Oz being due to bad behavior? From what I’ve heard it was done purely to address consumer demand.
See the 'Background' section on page 11 of https://www.nist.gov/document/sp1181-unit-pricing-guidepdf and more generally https://www.nist.gov/pml/weights-and-measures/laws-and-regul.... So yes, it was done purely to address consumer demand... by way of laws and regulations with producers and retailers under threat of even more onerous laws and regulations.
A contemporary example to hopefully convey the situation back then: if 'right to repair' becomes law at some point, this would also be due to consumer demand. Notice the level of interest companies have in addressing this consumer demand prior to legislation being passed...
Price/oz
Price/lb
Price/bar
Price/unit (which might be bar or package of two bars)
So you get tk calculate the difference in your head.
Maybe this is "my fault", but I'd guess that most consumers don't pay that much attention to the exact number of ounces (which are sometimes fractional) in the box.
Even then, I’m aware that many items have differences in content which game the price/measurement like a lower ingredient content (less cocoa per measurement and more fillers or water content).
There is not really a great way to combat these practices if you are not some kind of professional buyer that only purchases at wholesale scales.