Without in any way meaning to diminish your experience, the 'tough guy' 'in-your-face' move has a long, long history, and can be witnessed in nightclubs and pubs the world over with disturbing regularity.
The act of placing one's face into the face of another is, with some exceptions, a largely psychological endeavour. It represents an attempt to dominate someone. Such an act says, "Here I am! See? I have no fear of you. I am tougher than you. You should be frightened of me".
There is perhaps no one single best way to deal with this situation, as the aggressor may be very skilled or not skilled at all, fearless or secretly very frightened, eager to fight, ambivalent or reluctant.
One way to measure the success of your response (I'm assuming by your description that you didn't physically engage), is by its outcome. You remained passive and in this instance, you remained safe (barring any emotional scarring). So, maybe you can congratulate yourself on not making the situation worse. Had you engaged with him, you may have won, but of course, you may have been killed. The other side to this is that remaining passive makes you very vulnerable and had your aggressor decided to attack you, you would likely have sustained some form of injury, including brain damage or even death (I know that sounds dramatic, but you're in very real danger of being knocked out in such a situation, and the risk of falling head-first onto a hard surface such as the ground or the edge of a table is very real).
Although it can be a very intimidating manoeuvre, placing your face directly in front of an opponent's face is fraught with danger. It is just as dangerous to allow someone to do it to you. Why? Because it diminishes your ability to maintain observation of your opponent's hands and legs. You will be unable to see any weapon they're holding, and will be far less able to move out of range before any strike occurs. A head butt can be executed very easily, as can hand/fist strikes which emerge from down low and out of view, a knee to the groin, or many other techniques, including grabs and locks. All else being equal, the person who strikes first in this situation typically has an enormous advantage.
So, whilst it's not always possible by any means, especially if you have no or little training, one of the best approaches might be to ensure that no-one ever gets close enough to do this to you. This can be achieved by simply moving back or to the side, but again, without training, and depending upon your environment and your adrenaline levels, this can also be risky, and there's nothing to say your opponent won't follow.
A short, sharp palm to the chest, combined with some tactical communication, such as a simple, confident "Back off!" will often be enough to make someone think again. Of course, it may also provoke a fight, so the question becomes, do I want to let this guy get up close to me and hope he doesn't knock me out, or do I attempt to deter him/strike first?
There are no easy solutions to this scenario. In my mind, a person who finds themselves in your situation is more than entitled to engage in pre-emptive self-defence, and I would have no problem articulating my rationale in a courtroom. This approach however requires confidence and training, and even then, it comes with all sorts of risks, including the nightmare of having half a dozen of the aggressor's mates jumping on you at once.
If you have the opportunity to move out of range - even just for a moment - you might combine this with some other types of tactical communication, such as, "I don't want to fight you mate, but if you come close to me again, I'll be forced to defend myself". This is as much for the benefit of witnesses as it is a means of deterrence. If the incident is occurring in a public place, you want people to know that you weren't the provocateur and that you were trying to deescalate the situation.
I have been in this situation multiple times, both privately and professionally. In each instance, I avoided conflict with tactical communication, a defensive posture and by moving out of range (bar one, when I was forced to use the palm-push described earlier). This being said, I'm relatively experienced and was ready to engage should the need arise. It must be remembered though, I was very lucky that none of my opponents possessed greater intent and/or ability.
If you have no training, I would suggest that you remember the truism that someone who can't reach you can't hurt you. If you have the chance to back off whilst making placatory gestures and statements such as, "I don't want any trouble" etc., or to run (easier said than done, I know), this will often be the best response, although yes, some bullies will only be encouraged by vulnerability.
By this stage of my answer, you might be getting a little frustrated by the lack of clarity; by any definite way to approach this situation should it happen again. Fair enough. I'll leave it to others to describe any of the many, many stances/techniques relevant to your question, and limit myself to the following advice: (in no particular order):
Commence self-defence classes at a reputable school if you can.
Read this post.
Do your best to avoid/prevent the situation:
- Avoid venues with a reputation for trouble.
- Avoid places where you've encountered this individual.
- Leave a venue if things don't feel right.
- Avoid ego-driven staring contests, pool-table arguments and other verbal stoushes.
- Resist the urge to play the alpha male defender of your girlfriend (or boyfriend's) 'honour' when you're out at night, when it will only lead to unnecessary trouble.
- Go out with trustworthy, sensible friends.
- Minimise/eliminate your intake of alcohol and other drugs.
- Be ready to telephone for police assistance if you feel threatened. Many people are embarrassed to do this and leave it too late. Police would much rather arrive and not be needed than to have to deal with violence and its aftermath.