As far as my mIRC knowledge goes, I think that $foo definition is identified by :

alias foo { return 1 }

So searching for "foo" instead of "$foo" makes more sense to me, as "foo" will return every results, while "$foo" will only return identifiers call