The lost sock was
black
Let $B$ be the event that grandpa pulls a blue sock and $K$ be the event that he pulls a black sock. Also let $b$ be the number of blue socks and $k$ be the number of black socks. We are told that $b>k$ and $900<b+k<1000$.
There are four possibilities for the events of pulling two socks: $BB$, $BK$, $KB$, and $KK$. The probability of choosing a matching pair, i.e. pulling two socks without replacement, is $P(BB) + P(KK)$.
Calculations:
$$\begin{align} P(BB) & = \left( \frac b{b+k} \right) \left( \frac {b-1}{b+k-1} \right) \\ \\& = \frac {b^2-b}{b^2+2bk+k^2-b-k} \\ \\P(KK) & = \left( \frac k{b+k} \right) \left( \frac {k-1}{b+k-1} \right) \\ \\& = \frac {k^2-k}{b^2+2bk+k^2-b-k} \\ \\P(BB) + P(KK) & = \frac {b^2-b}{b^2+2bk+k^2-b-k} + \frac {k^2-k}{b^2+2bk+k^2-b-k} \\ \\& = \frac {b^2-b+k^2-k}{b^2+2bk+k^2-b-k}\end{align}$$
But we know that:
$$\begin{align} P(BB) + P(KK) & = \frac 12 \\ \\ \frac {b^2-b+k^2-k}{b^2+2bk+k^2-b-k} & = \frac 12\end{align}$$
Multiplying both sides by both denominators:
$$\begin{align}2b^2-2b+2k^2-2k & = b^2+2bk+k^2-b-k \\b^2-2bk+k^2 & = b+k \\(b-k)^2 & = b+k\end{align}$$
So
$b+k$ is a perfect square and $900<b+k<1000$. The only perfect square in that range is $961=31^2$, so $b+k=961$, i.e. there are 961 socks total. But this is $(b-k)^2$, so $b-k=31$.
Finally:
$$ \begin{align} b+k & = 961 \\ b-k & = 31 \\ 2b &= 992 \\ b &= 496 \\ k &= 465 \\ \end{align} $$
Since the odd number is
$k$
the missing sock was
black.