Esther,
This may not help in your situation, but I ran into a similar problem with 9.3.1. I finally added a few lines of code to to my 'looping script' to list all of the available tools (gp.ListTools and a 'for' loop to print the list).
In the printed list of tools, I noticed that the tool that I was calling within the loop was listed 3 times This was because I had added it to a couple of other toolboxes. Once I removed the other instances of the script tool from ArcToolbox, the problem went away.
-Steve