Can't you just wrap the whole expression in Min()?
if(sales>100 and sales<10000, sales/100,
Although I would probably recommend that in the script you define a factor and use this instead of the nested IF in the UI:
if(sales>100 and sales<10000, 100,
if(sales>10000, 1000))) AS SalesFactor
Then, in the UI:
Hope this helps,