Creating a two input two way digital switch
What you want is called a Bus Exchange Switch.  As an example, the logic diagram from the Onsemi 7WB383 is shown below.  It connects either straight through, swapped, or not at all, depending on the control inputs.    

The switches are available in different logic families and voltages.  Googling the term "bus exchange switch" will find you many possibilities.