If you have access to a welder the most permanent solution would be to weld two very strong support points to the down tube; this will prevent any movement, but since most ppl don't have access to a welder its kinda hard to do.
On my trike I bolted the motor to the frame, (please see CAD diagrams) so motor doesn't move at all; okay, let me rephrase that before I get schooled again in material deformation; the motor mount doesn't flex enough to be of any concern, haven't thrown chains and my alignment tape I put in there to check for flex hasn't moved a single mm. The sideplate modification that Robocam suggested (and implemented) adds another point of leverage to the motor itself, and by doing that it also cancels the lever that is created by the twist of the motor against the first point of support. The mod is also very easy to do too, and doesn't require a welder or any special tools. I use the hose clamp but no zipties, and installed it in such a way that the hose clamp on my eBike holds the motor up to the downtube and the motor rests on a small block of urethane that has the shape of the downtube on one side.
G.