Key Bindings can definitely give you the functionality you want. Here's what I do ...
Open Key Bindings.
Under Type of Keys, select MIDI and check Enable.
Under MIDI Shift Options, select Controller, and choose, say, 64-Pedal (sustain).
In the Key list, select, say, C3 (the lowest note on a 5 octave synth).
In the Function list, select Transport | Record.
Click Bind.
Check "Save Changes for Next Session", and OK to dismiss the dialog.
Now arm a track and press your sustain pedal, hold it, and play C3. Voila! SONAR starts recording. Press the sustain pedal and C3 again, and SONAR stops recording.
You can use the MIDI controller of your choice, or even another MIDI note, as the shift option. Choose something that's easy for you to remember and isn't something you'd ordinarily do while playing/recording. You wouldn't want to stop recording accidentally, just because you sustained a low C!