Note that since you know $\sum_{y \in Y}y$ for each $Y$ with $|Y|=\frac{|X|}{2}$, you know $x_i-x_j$ for each $i \neq j$. Just take $Y_i$ to be any set containing half as many elements as $X$ and containing $x_i$ but not $x_j$, and $Y_j=(Y_i\cup\{x_j\})\setminus\{x_i\}$. Then $\sum_{y \in Y_i}y-\sum_{y \in Y_j}y=x_i-x_j$.
I'll demonstrate with $|X|=4$, so $X=\{x_1,x_2,x_3,x_3\}$. Then as you note, you can calculate
$$((x_1+x_2)+(x_3+x_4))^2=x_1^2+x_2^2+x_3^2+x_4^2+2(x_1x_2+x_1x_3+x_1x_4+x_2x_3+x_2x_4+x_3x_4).$$
Now using the result of the first paragraph, we can also calculate
$$(x_1-x_2)^2+(x_3-x_4)^2=x_1^2+x_2^2+x_3^2+x_4^2-2(x_1x_2+x_3x_4)$$
$$(x_1-x_3)^2+(x_2-x_4)^2=x_1^2+x_2^2+x_3^2+x_4^2-2(x_1x_3+x_2x_4)$$
$$(x_1-x_4)^2+(x_2-x_3)^2=x_1^2+x_2^2+x_3^2+x_4^2-2(x_1x_4+x_2x_3)$$
So summing all 4 displayed equations gives $4(x_1^2+x_2^2+x_3^2+x_4^2)$. The left hand side of each equation can be calculated from the information given, and so $\sum_{x\in X} x^2$ can be calculated from that information as well.
In general, if $|X|=n$, you'll want to calculate $\sum_{i=1}^n(x_i-x_i')^2$ over all possible pairings of elements $\{x_i,x_{i+1}\}$, $i=1,2,...,n$. There are $\frac{(2n)!}{2^nn!}$ such pairings, and given a pair of elements $\{x_i,x_i'\}$ it will appear in $\frac{(2(n-1))!}{2^{n-1}(n-1)!}$ such pairings. So summing $\sum_{i=1}^n(x_i-x_i')$ over all possible pairings yields
$$\frac{(2n)!}{2^nn!}\sum_{i=1}^{2n}x_i^2-2\frac{(2(n-1))!}{2^{n-1}(n-1)!}\sum_{i <j} x_ix_j.$$
As you noted, you can also calculate $\sum_{i=1}^{2n} x_i^2 + 2\sum_{i < j} x_ix_j$, so with some algebra you can isolate $\sum_{i=1}^{2n} x_i^2$.