The employee probably didn't have a choice...the store ought to empower staff to say, "It looks like it is going to take a little time to address your situation, let me quickly help this other customer first."
If I have complicated/long request I do not mind letting one or two faster people go through. As long as my situation gets proper attention after that, and the place is genuinely short-staffed, I am fine with it.
Like you, I leave if I have to wait too long, especially if I can tell the previous person isn't taking a long time because their situation is genuinely complicated, but simply because they are being an ass.