Not sure how this would work (I am a software guy; hardware is magic I leave to you), but I think you could figure it out based on what I wish I could do…
I would like FTDI pins coming out of my Arduino Pro Mini above and below the board. They could be sockets if that makes things easier. Anyway, in my case the ones on the bottom go straight into an xBee regulated Explorer. The ones on the top are to connect the FTDI cable to so I can upload code. What I would like is to magically disable the pins on the bottom if a cable is plugged in on top. Right now I have to remove the xBee to be able to program the Pro Mini. When it is all inside a case, this is no simple thing.