To be honest, it shouldn't actually compile at all, as the ENDIF statement is missing.
The difference is because debug mode adds in extra lines on every other line, which release mode does not.
In debug mode, it would look something like :
ON_DEBUG(1)
a=0
ON_DEBUG(2)
if a<>0 then
ON_DEBUG(3)
a=a-100
ON_DEBUG(4)
and so on, making it appear that the code works "correctly"
As mentioned previously you could either use if a<>0 then a=a-100
or
if a<>0
a=a-100
endif