DIN and DOUT actually run in parallel (according to their function) but share the same serial clock. For a wired build, you daisy chain blocks of DINX4 and DOUTX4; the newer smashTV ones should allow any order of these, but IMO it's best to split them into two distinct chains of DINX4 and DOUTX4. You count the number of shift registers of each type and define that in the setup file. Now each digital input or output (switch or LED) has a given "address" according to its position in the chain and which pin of the IC is connected. It should be okay to assign each function arbitrarily, so there's no requirement to match a DIN with a DOUT pin.