I am trying to write a code that executes when a condition is met. Currently, I am using while...loop, which I know is not very efficient. I am also looking at AutoResetEven
At least you can change your loop from a busy-wait to a slow poll. For example:
while (!isExcelInteractive()) { Console.WriteLine("Excel is busy"); await Task.Delay(25); }