Description
A block begins with a BEGIN line and ends with a END. The job is prepending a COMMENTS: line before the END line if the block does not have one.
Raw Input Desired Output
some other
BEGIN
 block 1, line 1
 block 1, line 2
COMMENTS: add more
END
some other
BEGIN
 block 2, line 1
 block 2, line 2
END
some other
BEGIN
 block 1, line 1
 block 1, line 2
COMMENTS: add more
END
some other
BEGIN
 block 2, line 1
 block 2, line 2
COMMENTS:
END
Script and Comments
Script1
[ 1] /^BEGIN$/!b
[ 2] :loop
[ 3] N
[ 4] /\nEND$/!b loop
[ 5] /\nCOMMENTS:/!s/\nEND$/\nCOMMENTS:&/
Comments
  1. Step [1] is used to skip lines between two blocks.
  2. When the first line of a block is reached,
  3. the loop consists of Steps [2] thru [4] is used to join all lines of
  4. the block to the Pattern Space.
  5. If a block does not have a COMMENTS:... line, Step [5] will insert it.