I am a fellow leg-shaker and I understand your colleague's predicament, so perhaps I'll be able to give some insight. I haven't had any problems with it at the office due to layout, but it's brought up rather often in other settings, especially when I meet someone new and happen to sit next to them.
The movement is involuntary but will temporarily stop when you point it out, because the shaker becomes aware of it. However it's difficult to maintain stillness and it will probably start again in a few minutes, even if someone keeps asking me to stop. That's because there's energy that simply has to be spent, and if someone expresses irritation more than once I usually ignore them and say "you'll get used to it" (trust me, they do). That's probably not something I'd do at the office though. If it's practical I try to change my position or figure out a way that the shaking can't be seen, heard or felt.
In my prepubescent years I was diagnosed with ADHD and my parents were told that the shaking is related. It's not a serious medical condition by any means (not even a condition in my eyes), yet keeping still is just as annoying for me as it is for someone else when I shake. If I can't shake my legs I'll start playing with my slinky or a pen, and when I'm working I do both in excess.
Having said that, phoebu's answer is very clever indeed because the shaker can be made aware of the shaking, without having anyone to get annoyed at.
Other less practical options include a mat to dampen the sound, or sturdier / taller desks that don't get affected by the offending leg.