line changes the response, there is not a way to register the script (Close function) before that. That is why the script will simply not travel to the browser. Moreover, you are in the context of the RadWindow's page, so it is not possible to redirect to the main page. Also, redirecting the main page will effectively close the RadWindow.
You can use window.location.href to redirect to another page using client script. If you do not want to hardcode the url in the script, you can use window.location.href=param where param is the paramter to the function, passed from the code-behind.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed