I have
an ESQ-1. Thought I could help, but the ESQ-1 and the SQ-R are not in the same family, so I could be way off. The Ensoniq ESQ's require a "normally open" foot switch, and they do not have a setting to change the board to match the FS. As I said, the SQ's could be different. If you use the wrong one, the 'board sustains when the switch is NOT pushed, and sustain ends when you push it. If sustain is "backwards, you have the wrong pedal. Address the simplest thing first- the pedal. Test it with a ohm meter, or if you lack that essential piece of gear, plug the pedal into a Peavey 2-button guitar amp foot switch jack, or a single-button guitar amp foot switch jack, and the effects should come on/channel switch when the FS is pushed, but off when released- or vice versa. If this does, indeed, happen this will tell you if your FS is okay. If no change, FS is bad.
When buying a new FS, better to get one that is switchable for it's function (down-on switchable to down-off) so you can use it for other gear. Some FS's have a latch-on/latch-0ff switch, too.
Next, I'd do a system reset.
If you determine it is NOT the FS or system reset, I would have the battery in the SQ tested, and possibly replaced. (When I needed that done about a year or so ago, I found that Batteries Plus wanted LESS for the battery AND installing it than Rat Shack wanted for just the battery.) All kinds of weird things can happen with a failing battery. Save your patches and songs in the sequencer (wait, the rack version does not have sequencer, does it?), first.
Beyond that, you will probably need to have the unit serviced. Won't be cheap, I am afraid.