I/O between arduinos with opto coupling. Sample schematic

That's fine. All the resistors and wires are in the right places.

Note just by the way, that putting a HIGH to feed the LED will then switch on the transistor and pull the Arduino input LOW.

This is precisely as it should be, the safest way in case of short circuits. But your sketch logic will of course, have to expect this.