I think it would be more didactic to mention that it is an operator precedence issue:
not (which is a unary operator, with the operand on the right side of the operator) will be evaluated in the expression before the == operator (which is a binary operator, with one operand to the left and one the right of the operator). And that is because not has a higher operator precedence than ==.
http://www.lua.org/pil/3.5.html
so
not AddOn == MyAddOn
is the same as
(not Addon) == MyAddon
instead of
not (Addon == MyAddOn)
When you want to change the evaluation order, you can use the parentheses like in the last expression. So
Code:
if not (AddOn == MyAddOn) then
return
end