Hi Joey,
Without knowing more about your experimental needs, what you are doing seems like a reasonable approach. When controlling optogenetic light sources I would stay away from generating the stimuli using Bonsai (and communicating with Arduino with firmata) since we need millisecond precision. With that in mind there are a few possible solutions. The two easiest ones I can think of:
1. Do what you are probably already doing. Code your time sensitive logic in Arduino and use serial communication to turn it on and off by sending a character from Bonsai.
2. Use an arduino running firmata (look in the forums there are several examples) and use it as a slave to send digital triggers to a second pulse generator hardware (e.g. pulse pal, another arduino, etc...).
Now, on to your actual question. If I am understand your experiment correctly, the easiest thing is to run all the logic in Bonsai and simply send a turn on/off character to Arduino. If you just want to check if both conditions are met, replace the "CombineLatest" by a "Zip". Your two streams are tied to the same frame, as a result for each frame you are guaranteed to have paired "synchronised" values, so you can simply use "Zip". To check if both conditions are met you can simply add a "BitwiseAnd" node in front of Zip which compares pairs of values. If you want to use this output to filter some event, add a condition node (either after BitwiseAnd or even encapsulating the BitwiseAnd inside the condition node). This event can then trigger a character to be sent to arduino (solution 1) or a digital output (solution 2).
I hope this helps,
cheers,
B