Push button widget only works from standalone program

My pushbutton widget functions as expected when I use it from a stand alone program, but when I try to control an output pin on an esp8266 that has a program with multiple blynk functions and other functions I can’t control the pin with the push button widget. In the past I haven’t had any issues with that type of control so I don’t know what’s changed.

I tracked the problem down to a small block of code in an if /else loop.
if I comment out the else part of the loop the pushbutton widget works.
I’m not sure what the issue is with the loop, but I think I will figure it out.