// reeftank controller guidance plz

I didn't quite follow that circuit using a SPDT relay to drive the blue/white LEDs. Firstly because the diagram shows the relay in a mid position, but a conventional SPDT relay has a common contact, a normally open contact and a normally closed contact; except when the relay is in the process of switching, the common terminal is connected to either the NO or NC terminal. Secondly, I don't understand why one LED is backwards and there is another diode between them. Is there something clever going on here - if so, what?

As far as sketch design goes, I suggest that you design the sketch to be non-blocking and modular. Implement each major functional area with whatever global data it requires, and functions to be called from setup() and loop() to carry out the corresponding behaviour. These functions should be non-blocking (should not stop and wait for some external event to occur). The preferred approach to implement this is to design your code to check for events that might need to be handled, such as input arriving on a serial port, or some scheduled action being due. The 'blink without delay' example sketch demonstrates how to use this approach for simple timed activity (blinking an LED on and off at regular intervals) and I recommend that you follow a similar approach for the other things your code needs to do. In this way your code can check for and handle all the tasks that need to be performed, without any piece of the code needing to cooperate with or be aware of what any other parts are doing. The only overriding requirement is that you stay within the total available memory, and that all of your code completes quickly enough that you can complete the loop fast enough to meet your latency requirements.