You need to store the "parameters" to a session scoped variable and then read those values from the intermediate XPage.
As far as the button not working a second time add the following code to the link/buttons CLIENT SIDE event
setTimeout(function() { XSP.allowSubmit() }, 1000);
then you can submit multiple times.
FYI, if you do a full refresh from the button then you don't need the intermediate XPage (XAGENT) as you can simply put all of the ssjs code in the link event