You’re on the right track, you should enable / disable motion detection based on the mode.
If you’re using the Foscam Camera Manager you can configure this from within the SmartApp itself:
There are lots of other third party smartapp / routines options to enable/disable based on modes.