Despite the fact that the noise caused by the comments greatly decrease the readability of the otherwise perfectly obvious Sed source code, even a superficial glance immediately revealed that nested loops are not collapsed, i.e. [...] is always equivalent to [[...]] or [[[...]]].
I hope this gross oversight will be addressed soon.