You know how artists will use a bunch of plates (or other objects) to make a giant version of the Mona Lisa or something like that to make a photographic mosaic? It's like that. Each line makes sense, but you've got to have some real vision to make this happen, and it's really difficult (nearly impossible) to see the big picture by just looking at a small part.
It doesn't look that complicated compared to normal sed usage. It's just a series of find/replace for the most part. That said, regex is always pretty hard to read, and putting it together like this is impressive to say the least.
That's probably because you used BSD sed. Running it on my BSD sed also gives an error, presumably because it thinks the `}` is a part of the label in `binput}`.
However it works fine in GNU sed, and now that you mention it, GNU sed's extensions were not used, like the `-z` flag to slurp all input in one "line" to avoid `:input;$!{N;binput}`.