What engine are you talking about, here, ahramin, as shaking like dickens?
I'm trying to get a FlyEFII electronic fuel ignition and injection system working right now, the only way to shut it down correctly is to remove power to the system. In this case with a key. Interestingly you can shut down just the ignition system which should get the same results and turning the mags off on a legacy engine but this leads to a very rough shutdown since the injectors are still metering fuel into the engine very precisely as the prop slows down. The residual heat in the cylinder ignites the fuel / air mixture at random and everything shakes like the dickens. It sure feels like it could damage something.
Is it a 'legacy engine' - which I take to be a 'standard' injected Lycoming or TCM engine - to which you have fitted a FlyEFII system? Or are you talking about a 'standard' injected Lycoming or TCM engine with 'standard' ignition?