The solution Kean posted on his blog has a few problems.
One is that he assumes that there is an active document to send a command to, which may not be the case since the PaletteSet could be visible in 'zero-document state' (e.g., there are no documents open). In that case, kaboom.
Another problem, which affects most kludges that involve sending strings to the command line, is that the command that closes the paletteset could be scripted by LISP, and what follows that could be a prompt from LISP requesting some input. Unfortunately, Kean's solution will send its command string to the command line while the LISP script is waiting for the user to type a response, and the command string ends up satisfying the input request.
You can avoid all of the nonsense related to that solution, by trying this one (and remember that you can't assume there is any open documents when a PaletteSet is closed):