I've tried a few of the MVC pipelines, and within there I've used Sitecore.Context.ClientPage.ClientScript.RegisterClientScriptBlock(). The code runs with no errors, but the page never has the script added. Perhaps it's a timing thing with the order of the pipelines, I don't know.
Has anyone had any luck with doing this sort of thing before? How can it be done?