The logic behind the idea I have right now is as follows.
There is a mechanical switch inside the headphone socket that is either open or closed depending on whether the headphones are plugged in or not. This switch does not switch the two "analog" lines (L+R) to either phones or speakers otherwise the machine(s) would behave identically in OS9 and OSX.
It is, most probably, sensed by TAS3004 or some glue logic and, depending on the initial state, simply switches to the "other" state when phones are plugged in. I suspect, if one manages to change the initial state of TAS3004 to the "other state" when it is initialized upon startup, it will behave as expected. It might be as simple as a matter of "0" or "1" somewhere. One byte.