I am not exactly sure I understand what you have done, but here is a comment based on this interpretation that you have put the search saving code in your theme's search.php page.
Each time the page gets loaded your code will be run. So, it will be run when page 1 is displayed, when page 2 is displayed, etc. You can test the page number and only record the search when page 1 is shown. That will reduce the number of times it gets stored. You could also come up with some sort of hash code for a particular search based on the IP address and whatever else you might find that indicate it is a unique search. Then you could see if the hash already existed and not store if it does.