"anything" is correct here.
"Something" would refer to a specific thing which was intended to be said.
If that is what you mean, you would say:
"I was going to say something, but I was too surprised"
"I was too surprised to say something that needed saying"
or whatever it is that would have qualified that "something".
But in this context, "anything" covers all and every one of the possible "somethings" which may have been in your mind to say at that time -- and because of your surprise, you could not say any of them.
The point is, this is actually a negative sentence. "I could not say anything, because my surprise prevented it."