Create a keymap to modify a Preference?

It’s possible to create a keymap to modify a Preference?

I mean:

I know we can change the Behaviour for Spacebar from “Play” to “Search” going to Preferences > Keymap > Preferences > Spacebar Action.

Well: Would it be possible to create a keyboard shortcut to toggle that behaviour?

Thanks!