Been looking at the source, got to say, what were the people that were writing the code generator thinking? They've written a lot of expressions in a very strange way, as in the opposite to how you would normally read code, like "if (0 == something)" .....
Makes for a real head ache to read it... If someone knows of a legit reason for doing that, I would like to hear it.
If you have a debug tool (PICkit or ICD), I would suggest putting some breakpoints in through the UART related code and make sure that the correct code paths are being executed.
You say when you move the UART write out of the loop it works .. does the LED still come on when you try to turn it on from inside the loop?