Helen,
When you put in that code, what does the popup show when you click on it? Are you at least seeing the words "open link" in your popup? Or is it something else (like the unclickable hyperlink? Is there a way to verify that the code is working by having it throw that variable into some kind of text to show that "open link" is the correct text and that it has the associated hyperlink with it?
Also, in your logical statement of checking for http: or https:, maybe you could just check for "http" since that would grab both cases and would cut down on any potential logical issues. So, this:
if (value.search("http") == 0) {
content.replace(value, '<a href="' + value + '">open link</a>');
}