This works out of the box on most other models, where IS is active by default during standby. The only exception I'm aware of is 50D, where one needs to keep the shutter pressed halfway while recording in order to activate IS.
If the EOS M is different, you may want to document its behavior (when IS gets activated by Canon firmware, when it's stopped, whether the same happens in movie vs photo mode and so on). On most other models, in LiveView, IS is enabled by half-shutter in photo mode and stays active for a few seconds after releasing half-shutter, but it's always enabled in movie mode, including standby.
To understand how it works, you need to know the IS is handled by a secondary CPU -- the MPU, which also controls the buttons. If the IS is triggered by half-shutter, then it's very likely the MPU deciding to activate the IS. If it's triggered by actions performed on the main CPU (such as starting H.264), you can find what the main CPU tells to the MPU when that happens, using the
startup-log-mpu build.