I built a box similar to what you want to do:
I got a relay from allelectronics.com , a project box and a set of RCA connectors from Radio Shack (you can get them also from the above place which is probably better and cheaper. and after about 1/2 hour of soldering I was done. I did not even install a switch. Whenever my HU is powered on, the relay automatically switches the audio from HU to the amp, and if HU is off, MP3 is connected.
I even switched the cable shields this way! You can use two relays to accomodate all rca plugs (each RCA has a main lead and a shield) or you may be able to connect all sheilds to the ground and use one relay. I don't know enough about electronics to say which is the correct way. I just decided to switch mine just in case I was not supposed to ground them. You fit all of these in a box and you are done!
Here is a rough drawing of the connections: