It means, "Damn it to hell."
The origin of "Blue blazes" isn't too clear in my quick search. "Blazes" (= fire) is hell, but why "blue"?
I will guess that it's a euphemism for "bloody hell," which I gather in the UK is more offensive than in the US (some UKer help me here). Someone starting to say "bloody hell" might have stopped at the "bl..." and substituted "blue blazes" as a less offensive alternative.