It isn't possible to synthetically generate a hardware device key-press using Keyboard Maestro, and in your example could cause that macro to repeatedly call itself!
I would suggest trying a different tack, and simulating whatever action you've assigned to the side button on the Wacom pen instead.
So what I've done is set up the button in the wacom preferences to bring up an onscreen options box when i press the pen button in my design program (screenshot below). You press the button again to close it.
Now I've set up a action in KM that when i hold command and click this pen button, it saves the current document (command s) and then close it (command w). Obviously when i do this, because I've pressed this button it brings up that on screen options box. So when I do this action of saving and closing a document, i have to press the pen button a second time to get rid of the onscreen options box.
I thought if I added a simlated pen click at the end of my actions, it would automatically get rid of the options box by itself after i save and close a document, so i dont have to press the pen button a second time.
It sounds like simulating this pen button isn't possible so I probably just have to deal with pressing the button button again, or just simply try to not create any KM shortcuts that involve this pen button?
what happens if you add another Type a Keystroke, select the "Return" then press the button on the Wacom pen? KM will capture keystrokes and put them in the field. If the Wacom button isn't sending a keystroke to the Mac this won't work, but it would be my first try.
Yeah I had tried that. Unfortunately KM only seems to recognise/allow the button when i press it in a usb device trigger, but not as a keystroke action.