Hi ! A little information on your age and any ongoing treatment would have been more helpful. From the information provided by you, I can think of the following possibilities for your condition:
1) If you are standing for a long time at a single place, you may develop a vaso vagal response in which the vessels dilate and your blood pressure falls.This will make you feel dizzy and you will be relieved once you sit or lie down for some time. This is a natural phenomena.
2) If you are empty stomach at that time, you might have developed a hypo glycaemic attack due
low blood sugar level , and this may give rise to similar symptoms, which got relieved with the snack and water you took. This is more likely to be the case in case of Diabetics who are not careful in
dosing their medicines/
insulin with their food intake.
3) This can also occur in some conduction defects of the heart or in Transient Ischaemic Attacks due to any cause. I have mentioned these for your information only, and not to frighten you.
If it recurs, then I would advise you to see your family physician who after clinically examining you might advise also some basic investigations like
complete blood count, blood sugar, and an ECG. Thanks and good luck.