Switching a relay on and off using "millis()" without interfering with the runtime of the other piece of code

The variable a is only for the relay function to run once.
This code seems to work. Also, thanks for your ideas.