Starting with Tamino 4.4 (due next month), if-then-else syntax will be supported. With Tamino 4.2, you can use a notation with filters:
if A then B else C
corresponds to e.g.
(B[A],C)[1]
or
(B[A],C[not(A)])
for your example:
declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction’
let $persons:=(for $Person in input()/Person
where (tf:containsText($Person/Name ,‘for’))
return $Person/Name)
return
(
{count($persons)} [count($persons) gt 1000],
($persons) [count($persons) le 1000]
)