You could do
foo = isdefined(MyModule, :SN) ? SN : (x,y)->x+y
and then no checking is performed inside loops