What did the clerk see to know the attack was coming prior to the attempt?
I'm not him. But, in general, verbal and body language. The big guy wouldn't be standing there mouthing off if he weren't a threat. If he wanted to sneak the little guy, he should have pretended to be nice.
What did the clerk do to give himself an edge?
He didn't behave the same way the big guy did, and he didn't telegraph his emotions (spirit, shen, heart-mind). I.e., he stayed cool on the outside but had a fire burning inside.
How could the attacker have known it was a bad idea?
Imo, that's a silly question. Bullies don't think what they're doing is ever a bad idea. The question is why he thought it was a good idea, or an idea that wouldn't have consequences.
Would this likely stand up as self defense in court?
If I were on a Grand Jury and watched the video, I wouldn't charge the little guy with assault. He didn't have to continue hitting the big guy, but I don't think many jurors would indict. If the big guy got a concussion, or worse, and there were no video, I could imagine maybe a 3rd or 4th degree charge of misdemeanor assault.