Can you rule out scripting error by checking Get(ConnectionState) in the Data Viewer and comparing it with what your global variable is reporting?
If you're calling Get(ConnectionState) more than once in a session maybe you're running into this?
I will have to look into that. It seems that I have verified the connection state after getting fully logged in and that it did match, but not 100% certain. Of course, it hasn't failed in the past few days either...
I finally got a condition that was reporting state = 1. I checked the output of the 'get(connectionstate)' function in data viewer and it also was reporting state = 1. So it doesn't appear to be the issue you highlighted.