How to get last message in sequence of unknown length (1-3 messages)

Yes, I didn't show it checked in my screenshot to start this.

Of course if you want to see the really messy thing that I am trying to address, look at this post:
Color Bulb Synch

That makes this issue look easy.