Have you read and investigated the reasons for such behaviour in WWW::Mechanize::Firefox::Troubleshooting? That page has a section named "Clicking on a link makes a script waiit forever". Maybe the solution there helps you.
Comment on Re: WWW::Mechanize::Firefox Script Hangs after an Xpath click