It is possible to make logic gates using logic gates. Here is an example of a nand gate, where c = a nand b.
I do get that a specialized logic gate object would be useful tho, and I probably should have added it.
Yes, so the gates react to gates as well as items, so the orange gate sees that the red/blue gates are closed and reacts to that (and stays open because it's inverted), and then when red and blue are open, the orange gate no longer sees them and instead sees the item underneath (which it reacts to by closing since items always give a true signal and the gate is inverted).