Do, what Karzama said: Pick all items in region.
You can check for the item type as well for the item charges (integer comparisson).
I would check first for all stones in your region/range, if there is a stone with >=2 charges for your example. If there is reduce charges (if 0 remove stone) and create sharp stone. If there is no item with >=2 charges, then do a second loop, which searches for several items of type stone.
I think this is your question? Just save the first item of type stone in a temp variable ot type item called Stone_1. and ask before storing a stone into it, if it is null or if there is already a stone saved. If there was one saved, you obviously found a second stone and can combine them. Dont forget to set Stone_1 = null (no item) after the search algorythm.