However, there is no space after the text (with \r{if} or with \r{if }). I haven't researched why this is, but I expect it depends on the details of how @r is implemented in texinfo.tex.
It's not about @r (that just changes fonts). In TeX math mode, spaces in the input are ignored, because TeX puts in its own spacing. You could get a normal word space with $$ \r{if } ... $$ but normally you don't want word spaces in math, but rather actual math spacing amounts, e.g., \; for a so-called thick space, etc. Really supporting display math in Texinfo (including xrefs) has been on the todo list forever. Not to mention math itself. --happy hacking, karl.