Neither of your suggestions will reduce loading on mysite.com; in fact, the first will make it worse, because the mysite.com server would have to make an http connection to site2.com, retrieve the included file and then include it into the main file - and I don't think include can work with remote files anyway so that discussions kinda moot 🙂.
Experi{ence|mentation} has told me than your second suggestion (reducing the amount of plain HTML in the echo statement) offers only a slight benefit. It certainly does no harm to escape out of PHP mode into plain HTML, then back in for a brief moment to ourput a single variable's contents, then back out again. And PHP doesn't have to bother searching through that HTML to see if there are variables in it. But the difference is negligible (something like 4 seconds per 100,000 hits).
One thing I'd strongly suggest is that you use a database instead of your search.txt file; the time it's taking to read that in, parse it, and process it is definitely going to be bigger than constructing a SQL query, sending it to a DBMS process, and then looking through the results.
If you stick with the text file, then the in_array() function could do everything your loop is doing.
And lastly, I'm not at all sure about your frameset. thing. If all you're doing is redirecting the browser to another URL, then surely header("Location: $url"); would be sufficient?
That would still need two hits on the server (once to get this search script, once to get the redirected-to URL).
If the URLs are just local files, you can avoid this by using the fpassthru function to cause this script to output the desired HTML.
Then again, you could put the $url files on the second server, and have the first server redirect the browser there for them.
That's just a couple of PHP-level ideas for reducing server load.