that script is good, but there is a problem:
I have set firefox, when I right click on a link, to open the link in a background tab
so maybe you can adjust the script NOT to work when the cursor is a "hand" or IBeam, and when I focus on a link (not sure if AHK can detect this) (you know that when a cursor hovers over a link, it becomes underlined)?
also, can you enrich it, so that it when the cursor is IBeam, and perhaps there is some text selected (not sure if AHK can detect this), to copy the text? send ctrl+c?
last, the script works when I right click ANYWHERE on the screen, even outside the firefox window, while it should work ONLY on the webpage area, not in the Windows taskbar or the area of the tabs, etc