Custom action in admin menu

I've seen Akismet that they add a custom hover item ("History") to the comment menu which goes to the edit page and the #history div. Does anyone know how to add a function that is called from the admin hover menus (whether to a page list, post list, comment list, etc) that performs a custom action and then returns to the page list? In other words, can I just write a custom php page, pass in the variables I need in the a link, process, and then just redirect to the original page, or does wordpress provide some functionality I should hook into?