Help needed on synchronizing switch button widget mid-program

Hello, i am making a project (with nodemcu) that whenever you press a widget button (switch type) it starts a procedure that goes through 3 functions with 3 different timers until it reaches a conclusion. SO far so good.
The problem is that, if i try to stop the process mid way, and press the button (OFF) it doesn’t do anything. To add salt to the wound if i use 2 push buttons (one for ON and one for OFF) i have no problem. The OFF button turns the procedure off whenever pressed, be it 1 second after i pressed the ON button or 1 second before the procedure would finish. Is there any way of updating the widget button state even do i am outside of loop() function !?

to understand the process of my algorithm:

ButtonPressed -------(goes from BLYNK WRITE to 1st funtion) ------>>> 1st function ------(this function makes some checkings and calls itself for 6 seconds then calls the 2nd function) ------------->>> 2nd function ------(this function also waits 4 seconds to get a signal to a pin; if the signale it’s obtained returns 1 and the procedure ends and goes back to loop(); if the signal it s not obtained it goes back to 1st funtion and does the same routine for a total of 3 times; then it gives up and goes back to loop();

What detail you have provided is insufficient to ascertain what if any suggestions will work for you. Any code?