UKHeliBob:
Do you really care if the digitalWrite()s happen over and over ? The Arduino certainly won't careIf you do, then introduce a boolean variable with a suitable name, perhaps ledHasBeenWrittenTo and set it to true when you write to the LED and make the writing to the LED dependant on the variable being false. Change the variable to false when you change the state of the LED
I am not sure indeed; but I am writing this code for ESP8266, and maybe indeed there too it does not matter?
Would it make cleaner code? Execute faster? Use less memory?.. I am not yet sure enough where to draw the line when or when not to prevent tasks repeating themselves endlessly.