You can directly use robot variables in expressions by removing the curly braces from the variable name.
${result}= Set Variable If $text1 in $text2 ${TRUE} ${FALSE}
This is covered in the BuiltIn Library documentation under a section called Evaluating Expressions
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…