Create a dual or 2 conditions together for the AI slab and squares as follows:
On touched object > AI Slab > What ever your event
On touched object (X) > square >
the (X) being inverted
this will keep the AI slab from activating an event meant only for the square and probably you need to do the reverse for the square.
On touched object > square > What ever your event
On touched object (X) > AI Slab >
You might need to make the inverted condition in each scenario "is in touch" because C2 might not let you couple the identical conditions. But you should get the general idea.