What is the right way to wire a power inlet to a switch to a dual-primary transformer?
The four outputs on the inlet are numbered 2-4-3-1 from the top down in the diagram.


Your link to the diagram is broken, I will assume it's the same as the diagram in http://www.farnell.com/datasheets/1511815.pdf


  I think that wires 1 and 4 should run to the two closed terminals on the switch, and the common terminals on the switch should run to matching wires on the transformer. Wires 2 and 3 should go directly to the transformer.


What you propose will work but your double pole switch will effectively only provide single pole switching. If you wanted full double pole switching you would need a four pole switch.

That is probablly not a problem for a functional switch on a transformer powered device but it's something to be aware of.


  PS: I know that the inlet has a built-in switch. I want a separate switch because it has a nice LED on-off display and will be on the front panel of the device, rather than its back.


You might want to think about how the indicator light (it's probablly a neon not an LED) will end up connected in both 120V and 240V modes


  PPS: When connecting mains wires to the primary windings, does polarity matter?


It matters that the two windings are connected with the same polarity. Otherwise they will "fight" each other resulting in an effective short circuit.