The point is to use the Klein Gordon operator on the T-product. Note that it is defined as T(\phi(x)\phi(y))=\theta(x^0-y^0)\phi(x)\phi(y)+\theta(y^0-x^0)\phi(y)\phi(x) which means that when you apply the spatial derivation it passes through the thetas and acts directly on the fields. The time derivative needs a little more attention. You can perform an explicit calculation:
$$\begin{align}
\partial_0 T(\phi(x)\phi(y)) &= \theta(x^0-y^0)\dot{\phi}(x)\phi(y)+\delta(x^0-y^0)\phi(x)\phi(y)+\theta(y^0-x^0)\phi(y)\dot{\phi}(x)-\delta(x^0-y^0)\phi(y)\phi(x)\\
&=\theta(x^0-y^0)\dot{\phi}(x)\phi(y)+\theta(y^0-x^0)\phi(y)\dot{\phi}(x)
\end{align}$$
where I have used the commutation relation at equal time and the fact that the delta is the derivative of the theta.
To have the KG operator you have to perform another time derivative and thus obtain, with the same procedure:
$$\partial_0^2 T(\phi(x)\phi(y))=T(\ddot{\phi}(x)\phi(y))+\delta(x^0-y^0)[\dot{\phi}(x),\phi(y)]=T(\ddot{\phi}(x)\phi(y))-\delta^4(x-y)$$
where I have used again the commutation realtion at equal time (because of the delta).
Now, every other term in KG operator pass through the thetas and so you have:
$$(\Box+m^2)T(\phi(x)\phi(y))=T((\Box+m^2)\phi(x) \phi(y))-\delta^4(x-y)=-\delta^4(x-y)$$
because \phi is solution of the KG equation.
I hope this was the answer you were looking for.
Einj