There are options :
Uncle Erik's advice with a splitting cable, although the side effect of that is that both the speakers and headphones will be active all the time. But if the connections are so much easier to get to than swapping at the back of the computer.
Some computer audio systems (motherboard and/or PCI card) allow connection to a "front panel" audio set. Software on some will turn off the rear connectors when a headphone is plugged in on the front side.
If you build one, I don't recommend the volume control, I felt it altered the sound when it was engaged. I don't think it would be hard to wire up a box like you want, with all the parts easy to find at Radio Shack. You can make it with a switch to swap the outputs, or a simpler one to just defeat the speaker output. More elegant is to use a "shorting" headphone jack, that will turn off the speaker outputs whenever the headphone jack is fully inserted. On this type of jack, there is another connection at the furthest inside part. This breaks the ground connection from the 4th connection when the headphone plug is pushed all the way in. It is connected when the plug is withdrawn, completing the ground for the other output, making it functional.