In general: $if() expects a boolean result (i.e. something is true or false) but you have to include some kind of comparison that can be true or false.
Right now, I don't see a comparison operator.
You can test your expression in Convert>Tag-Tag and see in the preview if it produces the correct result.