I'm interested to know what application such a lossy conversion is useful for. I can't think of anything you could do with a unpretty-not-necessarily-compilable script other than hash it for uniqueness (which you could do more usefully to the unmangled script).
Out of curiosity, could you tell us more about your purpose please?