The dimmer switch just supplies a ground to the headlight circuit. Looking at those three wires (in your first picture above) that came loose out of the broken switch, the Black is the ground, The Red/White is the High Beam ground (I think) and the Red/Yellow is the Low Beam ground. The switch just changes which wire gets connected to the Black ground wire.
To get by, you could just connect the black wire with the Red/Yellow (If that gives you high beams when you switch the lights on, I was wrong - so, just connect the Black to the Red/White instead). Then you'll have Low Beams for driving while you find a replacement for the broken switch.
The Ground is always connected to one or the other depending on the position of the switch so you don't need to worry about leaving the wires connected. Power to the headlights comes from the headlamp switch on the right of the steering column.