220 VAC/110 VAC to 24 VDC
You are, I'm afraid, approaching this wrong. You seem to think that rectification and regulation occur after the transformer. While this is true for simple supplies, especially those with linear regulators, that's not how it's done in universal supplies.

For these supplies, rectification and 1st stage smoothing take place at line voltage. This means that the input capacitors are rated at 400 to 450 volts.

Regulation then takes place using a switch-mode regulator which will handle a 2:1 input range, followed by a second stage of smoothing at the output voltage. The relative insensitivity of a well-designed switching element makes the power dissipation low and allows the approach.

With that said, there is a conceptually simple approach which you can look into, although I doubt very much that you'll get much joy out of it.

Charles Cowie provided a schematic for switching a dual-winding transformer. If you can find such a beast, you could replace the switch with a relay whose winding is activated by AC at a voltage of about 170 VAC. An input of 230 VAC would produce a different contact connection that 120, and the transformer/relay combination would auto-select for the proper transformer connection.

Of course, you'd need to design your regulator to accept transient voltages twice the optimal, since it would take a fraction of a second to respond to application of 230 VAC. Power dissipation, though, would not be an issue due to the short high voltage time.

Another issue is relay response. A relay, once activated by a rated voltage, will typically remain activated until the input voltage gets quite low, due to the armature being pulled close to the magnets. This would only be a problem if you somehow operated in an environment where the power voltage varies from 230 to 120 with no dead period. It would not be a problem for simply responding to being plugged in to an arbitrarily-chosen socket.