you can use the X-Function wxt, like
wxt test:="i==1||mod(i,2500)==0" sel:=1;
Please note that the condition expression must be standard Labtalk notation, while the Worksheet Query dialog you can use more relax notation like "i=1 or mod(i,2500)=0", which is a good place for you to test the condition, then write it out in the more strict form in script.
CP