There is a subtle distinction between the two uses and it has to do with the specific time being emphasized.
Then I realized that my scarf was missing.
This is a past tense equivalent to:
I just realized that my scarf is missing.
The meaning is that the character is expecting the scarf to be there but it isn't; it is missing.
Then I realized that my scarf went missing.
I just realized that my scarf went missing.
Here, the scarf "went" missing at some point previous to the realization. The connotation is that the scarf left and it did so at some point in the past. It doesn't really matter whether the realization is happening in the present or the past since the scarf will always have gone missing before the realization itself.
This distinction is most noticeable when you move into the future:
In one hour he will realize that his scarf went missing.
In one hour he will realize that his scarf is missing.
In the first sentence, the scarf could have gone missing at any point before the realization; in the second sentence the scarf most likely went missing before the sentence itself was spoken.
Another easy way to spot the difference is to use both in the same paragraph:
Then I realized my scarf went missing but I've since found it. It is no longer missing.
Then I realized my scarf went missing. It is still missing. Have you seen it?
Then I realized my scarf was missing. It is not missing anymore. But it still went missing.
In the final example it would sound somewhat strange to say, "But it still was missing."
As a concrete answer to your specific question, you can certainly use both variants in this particular context and they will mean roughly the same thing. The only reason to chose one over the other is stylistic emphasis.