Ok, I've had a little playaround with it, and I made a couple of changes. The way I called the script is a little different to how you called it, as in I haven't made a dialog interface. Instead, I called it via an ol' fashioned addaction (which is a form of interface).
I believe it is working as it should be. Everytime the player uses the action, the itemsleft variable decreases by 1 each time. If I get some time later I'll try making a quick dialog and trying it out on there.
Here is the working script (at least when using addaction):
? (Itemsleft == 0) : hint "You have exhausted your item supply. Find a facility to restock"; exit
? (Itemsleft == 3) : Itemsleft = Itemsleft -1; hint "You have 2 items remaining in your inventory"; exit
? (Itemsleft == 2) : Itemsleft = Itemsleft -1; hint "You have 1 item remaining in your inventory"; exit
? (Itemsleft == 1) : Itemsleft = Itemsleft -1; hint "You have used the last item in your inventory"; exit
;wasn't sure where to put this, or whether it would need changing
? ((Itemsleft < 2) && (player distance facility >= 1000)) : goto "confirm"
exit
I got rid of some of the < and > signs and replaced them with ==. As we're dealing with whole numbers, it seemed less confusing to me to use == signs instead, as the variable decreases by 1 each time.
itemaction = player addaction ["Take Item","inventory.sqs"]
^ That was how I called the script.
You could try using 'if', 'then', and 'and' commands to see if it makes any difference, but I can't imagine it doing so (but, consider every possibility)
Hope this helps
Gruntage
ADDITIONAL: I've attached a small missionette for you, with a simple dialog interface that I grabbed from another mission. I didn't change the dialog at all, so it's still in the format of a difficulty selection dialog. You can bring the dialog up by using 0-0-1. Select the EASY option. I didn't have much time so I didn't make any changes to the dialog appearance. Hope you find it useful.