The SetScript is creating the function "in situ" rather than calling another function. Either way works although the SetScript("script", function) is better if multiple scripts can use the same function.
If you mean the
Code:
if self[event] then return self[event](self, ...)
then in this case, self is JWFrame so,
Code:
if JWFrame["PLAYER_LOGIN"] then return JWFrame["PLAYER_LOGIN"](self, ...)
calls
Code:
function JWFrame:PLAYER_LOGIN()
A frame is a secial type of table so you can add attributes (variables) and methods (functions) to it like you would a standard table.