Two-port circuit with input/output duality
In the specific case where \$V_\text{out}\$ and \$V_\text{in}\$ take on only two possible levels, the device is known as a bidirectional (logic) level translator/converter/shifter.
In the specific case where \$V_\text{out} = V_\text{in}\$, it is of course a wire or transmission line.
In the specific case where the device can be switched between \$V_\text{out} = V_\text{in}\$ and no connection, it is a switch — or, if implemented in semiconductors rather than mechanically, specifically an analog switch or transmission gate.


I do not expect there is a formal term for the general case of this behavior because it's not a realistic "found" behavior in a circuit except in special cases that are best considered on their own. That said, “bidirectional” would be a reasonable word to use — just don't expect it to automatically imply everything you've described here.