Line one is your function, and it has two values that are passed to it: enabled and withDialog. I don't know what is being checked or how it's being checked for the enabled part, but it should be a true/false value.
Line two checks to see if the value enabled has any value at all or is false. The ! is used as a negative, so !enabled is seeing if enabled is not true. the != undefined checks to see if enabled has a value at all. I'm not sure you really need that. just a if(!enabled) should work.
Line 3 just tell the script to stop the function and return to the main script. if you had something after the return, it would return that value.
I hope that's what you mean my wanting to know what those 3 lines do.
Thanks Chuck, that has answered my question, it was the != undefined I was not sure about
Yea, like I said, I don't think that's really necessary, but if just the !enabled doesn't always work, you can add that back in.