The JTAG chain protocol handles all those situations. JTAG is simple but somewhat confusing. I hope this makes some sense . . .
The instruction registers of all your JTAG chain devices are connected in series as one continuous shift register. You never bypass instruction registers. For example, if your chain has three devices A,B,C with instruction word lengths of 5,6,7 bits, then you must always transmit an 18-bit instruction string like this: CCCCCCCBBBBBBAAAAA. Even if you only need to talk to device B, you must still include AAAAA and CCCCCCC in the instruction string, so simply set them to BYPASS opcodes (all ones). The full instruction string would be 1111111BBBBBB11111. All three devices now have their instructions, so you can send a data string. The data string travels from your JTAG controller through device A's one-bit data bypass register, then through device B's interesting data register, then through device C's one-bit data bypass register, then back to your JTAG controller.