if then problem

i made a box and i would like to apply edit poly automaticly

if $.modifier == undefined then

(

apply edit poly
)

else

(

pass edit poly
)

is that right ?