I assume the bag is to contain $k$ pairs, and no extra "singles" in it, as suggested by the approach of the posted question. And given that, in agreement with the post it follows that one wants to count the number of solutions to (1) with the restriction (2). Recalling from post:
$$ x_1 + x_2 + \cdots + x_{n-k} = m ,\tag{1} $$ $$ 1 \leq x_i \leq 2. \tag{2}$$
Now note that restriction (2) imposes two inequalities on $m$. If the $x_k$ are all at their lower bound $1$ we get $n-k \le m$, while if they are all at their upper bound $2$ we get $m \le 2n-2k.$ So the restriction on $m$ in terms of $n,k$ in order that there be any ways at all to end up with $k$ pairs in the bag is
$$ n-k \le m \le 2n-2k. \tag{3}$$
Now define $y_k=x_k-1$ so that $y_k \in \{ 0,1 \}$, and then we have $$y_1+\cdots +y_{n-k}=m-(n-k).$$
The number of solutions to this is the number of subsets of $\{1,...,n-k\}$ of size $m-(n-k)$.
Putting this count together with the $\binom{n}{k}$ ways to pick the pairs for the bag gives the result of the count (under restriction (3) above) as
$$\displaystyle \binom{n-k}{m-(n-k)} \binom{n}{k}.$$ Note here that $0 \le m-(n-k) \le n-k$ follows from restriction (3). Of course this is only the number of ways, not the probability; divides by $\binom{2n}{m}$ for the probability.
EDIT: I realized that the above is right, but it is the count of how many ways there can be $k$ pairs in the bag, with perhaps also other single unpaired balls. In the notation of equation (1) of post (and above), whenever $x_k=1$ it means that the other ball labelled $k$ is in the bag of unchosen balls. Nothing changes in the calculations above, luckily --- I was just not thinking right about precisely what is being counted.
EDIT AGAIN: I now think that, if the two balls of a given number on them are considered distinct, which is necessary for the denominator to be $\binom{2n}{m}$, then there should be an extra factor of $2^r$ where $r$ is the number of variables $x_i$ in (1) which are to have the value $1$. This is because, if $x_i=1$, it means that one of the two balls labelled $i$ is to be in the bag, the other not. I also think that if the balls of the same number on them are considered indistinguishable a more complicated approach to the count may be needed, and also the resulting probability may be different than in the "distinguishable pairs" case above.