Toggle Button Timeout Using Millis()

I think I understand your requirements, I think they are best met by restructuring the program to work on button state transitions where a button becomes pressed or become released rather than the button state (pressed or released) with a lot of logical conditions pasted on. You should be able to work the press and hold button independently of the timeout toggle button. Give me a day or so to work on this.

I see something like this

if button1 becomes pressed turn stuff on
if button1 becomes released turn stuff off

if togglebutton1 becomes pressed turn stuff on with timeout
if togglebutton1 becomes released do nothing

I'm not certain about the need for debounce, but I will probably use a button library (Bounce2) which simplifies reading the debounced transitions.