This script says look for yyy:. When found read another line into the pattern buffer (sounds like Star Trek Transporter). Now do a s/ command on the joined lines.
So we are looking for yyy: newline "". If found replace with yyy: \ notice backslash actual
newline then "new stuff"

I find once things get beyond a certain level of complexity, I switch to perl. s2p will handle the translation of your current sed solution. Or you could write it from scratch trivially. The search/replace expression will remain the same.