If you wish to steer clear of pharmaceuticals, deep pressure may help retain focus (at least it does for me). Also having a "stim toy" handy for when you cannot resist the urge can be useful. There are situations in which I can put off having to do it for a period of time, but then use the "stim toy(s)" when the urge builds up to a point I can no longer repress it (sometimes merely having it/them around, knowing it's/they're there if I need to use it/them helps as well). You can also reserve the stimming for times during a lecture, meeting, etc. when you already know what's being said or if what's being said doesn't apply to you (I call this "d*cking around").