Next time it acts up, don't shake anything. Try to keep it in the bad state. Shift to neutral, then try to start the engine. By "doesn't start", I'm assuming you mean it doesn't crank. Is that right? If it cranks in neutral, suspect the shift linkage is loose, sloppy, or misadjusted.