I don't know much about hl7 (in fact I know nothing about it) but it looks like you want to remove those lines:
# does this message have "ADDENDUM"?
if {! [regexp {OBX[^\r]*\|ADDENDUM} $msgdata] } {
# This message does not have an ADDENDUM, so continue the message
return "{CONTINUE $msgid}"
}