Something similar in this post:
Any how (like macro) to repeat last command?
To select all results use "-1".
Example: your last two lines can be
mapkey(continued) ~ Select `selspecdlg0` `ResultList` -1;\
mapkey(continued) ~ Activate `selspecdlg0` `CancelButton`;
It should work for your macro.
Jose