(very very very first thought on the matter
Such a script wouldn't be too hard to write, it would just have to be lauched as the first command in the .xinitrc, although if you went down that route it would need a GUI (even if it was just xterm -e myprog), it could write the requested window manager to a file and the script could read that later when it comes to running the window manager.