Don't see how the original expression could ever work for what you want.
If( IsEmpty( table::field ); $variable )
will return a null result if the field is not empty and that null value will then clear the field.
If you don't want to modify the field if there's data in it, perform a find that omits those records before doing the replace and they won't be modified.
You can do a find with just an = in the field if you want to find all records where the field is empty.