there's no need of a script...
Simply make the field Status a calculation field with calc:
Current number ≥ Max ; "Products sold out" ;
Current number ≥ Max - 2 ; "Few products left"
That worked perfectly..
But just to understand why the script didn't work, can you tell why? Even though it is not as simple as using a calculation field, shouldn't it work anyway?
It likely didn't work since you had multiple comparisons in a single expression without a logical operator:
If [Products:: Max > Products::Current number ≥ Products:: Max - 2]
you would write this as:
If [Products:: Max > Products::Current number AND Products::Current number ≥ Products:: Max - 2]
My guess is that the "Products sold out" insertion worked right, but the "Few products left" didn't when you ran your script. The "Products sold out" had only the single comparison.
As raybaudi described and you've already done, the calculation field would be a better approach in this case. The multiple comparison scripted "IF", however, can be part of your mental toolbox going forward.
Edit: Fixed typo...