Thank you all for the replies. The problem was because I am updating the property node on each iteration of the while loop. I should have updated the gain_to_add value 'inside' the case structure only when the overload was true. Rather I updated it outside for both true and false condition.
I will try to implement the other suggestions regarding the structure of the program. I think I do not have to worry about the boolean crossing. I am sorry about the use of word 'turns' instead of 'is'. Infact I want the signal to be triggered when the overload 'is' true. Once the event structure case is executed, the overload should become false as it is the status of the hardware. I was using bool control in my code only for testing purposes.
Thank you for the valuable feedback.