Yeah, I don't think you can nest IF/ELSE/ENDIF clauses because ENDIF operation is invalid if not preceded by an IF or ELSE. At least according to the Wiki documentation.
"OP_ENDIF -- Ends an if/else block. All blocks must end, or the transaction is invalid. An OP_ENDIF without a prior matching OP_IF or OP_NOTIF is also invalid."
Yeah, I don't think you can nest IF/ELSE/ENDIF clauses because ENDIF operation is invalid if not preceded by an IF or ELSE. At least according to the Wiki documentation.
"OP_ENDIF -- Ends an if/else block. All blocks must end, or the transaction is invalid. An OP_ENDIF without a prior matching OP_IF or OP_NOTIF is also invalid."