Print the parts with a RepRap. If your ABS is not opaque to IR you will need to paint it with something that is or wrap it in tin foil. I used black BBQ paint.
Fasten the tab to a bed corner bracket with two M5x15 bolts. Attach the opto PCB to the opto bracket with two M3x12 bolts and fasten the bracket to a vertical post with an M4x20 bolt.
Adjust the opto bracket angle so that the tab clears the slot and set its height to where you want the z-limit to be.