Thank you, @Tondose! OnExecuteCommand is exactly the way to go. I just don’t understand the purpose of the DESELECT commands; you don’t need them if you are not using cart selection anyway, and you just want to switch between pages.
Anyway, I have just uploaded snapshot 5835, and the command is now available as CARTWALL PAGE <number>.