In that example there's only one if/elseif statement, but in your code you have nested statements. I indented the statements so you can see where you need the extra end if.
Code:
i=0
if SEND_TO = NC then
i=i+1
end if
if UW_USERID = NC then
i=i+1
end if
if GOTO_AUTH = NC then
i=i+1
end if
if i = 0 then GETTRUEFALSE = FALSE
else
if i < 2 then GETTRUEFALSE = TRUE
else
if i = 3 then GETTRUEFALSE = FALSE
end if
END IF The end if in capitals is the one I added that you were missing.