in reply to Substitute within a search

My favourite solution to problems like these, is to replace those sections of text which you want to skip, by themselves — effectively only doing the real substitutions, in all other sections. Something like this:
s/(<pre>.*?<\/pre>)|\n/$1 || "<br>\n"/isge;
This way you'll only replace newlines that aren't in <PRE> sections.