For any $n\in\mathbb N$, let $h(n)$ mean the distance from $n$ up to the next power of $2$ -- that is, in symbols,
$$ h(n) = 2^{\lfloor 1+\log_2 n\rfloor} - n $$
It is easy to see that if $a+b$ is a power of $2$ and $a\le b$, then $a=h(b)$. Therefore, the condition of $T$ is equivalent to saying that $T$ does not contain both $b$ and $h(b)$ for any $b$, or in yet other words $T\cap h(T)=\varnothing$.
Let $S^*$ be $S\setminus h(S)$, the elements of $S$ that are not hit by $h$. These elements are "gratis" to add to $T$ in the sense that if $T_1$ satisfies the condition, then
$$ T_2 = \bigl(T_1 \setminus h(S^*)\bigr) \cup S^* $$
will be another qualifying $T$, and in addition $T_2$ that has at least as many elements as $T_1$. Namely, each element of $h(S^*)$ that was in $T_1$ but is removed corresponds to at least one element of $S^*$ that is added.
Therefore, we can assume without loss of generality that a $T$ of maximal size contains $S^*$.
For $S=\{1,2,3,\ldots,1000\}$, we have $S^*=\{513,514,\ldots,1000\}$, so these $488$ elements are certainly in $T$. And $h(S^*)=\{24,25,\ldots,511\}$ so these elements cannot be in our $T$. Neither can $512$, of course, being a power of $2$ itself.
So all we have to do now is to supplement with as many elements of $S_2=\{1,2,3,\ldots,23\}$ as we can. But that's just a smaller instance of the problem we're already solving, so we can proceed recursively:
$$ S_2^* = \{17,18,\ldots,23\} \\
h(S_2^*) = \{9,10,\ldots,15\} \\
S_3 = \{1,2,\ldots,7\} $$
(ignoring $8$ which is a power of $2$)
$$ S_3^* = \{5,6,7\} \\
h(S_3^*) = \{1,2,3\} $$
at which point we have exhausted the entire original $S$. Therefore, a $T$ with maximal size is
$$ \{5,6,7,17,18,\ldots,22,23,513,514,\ldots,1000\}$$
with
$$ 3+7+488 = 498 $$
elements.
This is not the only possible $T$ with $498$ elements, though. For example,
$$ \{5,6,7,17,18,\ldots,22,23,24,513,514,\ldots,999\}$$
would also work.