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

if serial available OR analog read is 2V..... first read the char that MAY NOT BE THERE?
That's what your code does.

That's just one line begging to be a bug that I am not tracing down to fix. One of many puzzles that include mixing millis timing with blocking commands and loops.

All at once? Don't you need to get text BEFORE voltage?