Keyboard shortcuts for dynamic menu items (Keynote)
This doesn't solve the general case problem of how to assign a keyboard shortcut for any dynamic menu item, but it does solve the specific problem of having a keyboard shortcut to hide or display slides in Keynote.

We can work around the shortcut problem because Keynote is AppleScriptable.

Create a new service in Automator.

The service takes no input in Keynote.app.

The service has a single action: Do AppleScript. The script (in all its one-line beauty) is:

tell application "Keynote" to tell current slide of the front slideshow to set skipped to not skipped


Save the service as "ToggleSkipped".

Use the Keyboard Shortcuts tab within the Keyboard pane of System Preferences to bind the service to an unused keystroke.