Could I get some advice on Improving this coding please?

  1. Whats the best way to read the ultrasonic sensor in real time, so its not waiting for the fade cycle to finish?

The best way is to do your fading based on the passage of time, not based on step-and-delay. This will require major changes to the code. For each of the fade loops you now have you will need a 'state' pointer. This is usually just an integer to keep track of which loop you are currently in. When the distance range changes (you'll need to keep track os which range you were in) you set the state to the first fade for that range. At the end of each fade you need to change the state to the next fade. After the last fade in the range, go back to the first fade.

  1. Also, I would like the LEDs to go up and down in brightness as they switch between colours.Can anyone think of a cleaner/easier way to dim the LEDs whilst it is fading? Obviously I can drop the R/G/BBrightness values, but that could end up a very long code. Is there anyway to say, every .5 seconds divide R/G/BBrightness value by 10 for a couple of hundred milliseconds, then knock it back up again?

If the brightness is controlled separately from color you might want to switch from the RGB model to the HLS (Hue, Lightness, Saturation) You can fade between hues (colors) and pulse the Lightness. Each step you translate HLS to RGB and update the outputs.

3: Finally, any tips on cleaning up the above/better ways to do this?

See the answer to question 1.