The time-ordering operator just orders time-dependent operators in a product according to their time arguments (from right to left in ascending order). They don't care about any commutators.
Your definition of the time-ordered Green's function is correct with this definition. The time-ordering comes into the game when solving the time-evolution equation for an explicitly time-dependent Hamiltonian. This happens, e.g., in the usual interaction picture, where the operators time-evolove according to the free Hamiltonian ##\hat{H}_0##, and the states with the interaction Hamiltonian ##\hat{H}_I##, and ##\hat{H}_I=\hat{H}_I(t)## is usually time-dependent. The time-evolution operator ##\hat{C}## for the states obeys the equation of motion
$$\mathrm{i} \hbar \dot{\hat{C}}(t)=\hat{H}_I(t) \hat{C}(t),$$
which you cannot so easily integrate as it might look, because the Hamiltonian ##\hat{H}_I(t)## may not be commuting at different times.
The key to a (formal) solution is to rewrite the equation of motion (eom) in terms of an integral equation, working in the initial condition ##\hat{C}(t_0)=\hat{1}##. Integrating the eom then leads to
$$\hat{C}(t)=\hat{1} -\mathrm{i}/\hbar \int_{t_0}^t \mathrm{d} t' \hat{H}_I(t') \hat{C}(t').$$
Now you can solve this equation iteratively, i.e., you start with the (very crude) approximation ##\hat{C}_0(t)=\hat{1}## and plug this approximation into the right-hand side of the integral eom, giving you
$$\hat{C}_1(t)=\hat{1} - \mathrm{i}/\hbar \int_{t_0}^t \mathrm{d} t_1 \hat{H}_I(t_1).$$
This solution you plug again into the right-hand side of the integral eom giving
$$\hat{C}_2(t)=\hat{1} - \mathrm{i}/\hbar \int_{t_0}^t \mathrm{d} t_1 \hat{H}_I(t_1) + (-\mathrm{i}/\hbar)^2 \int_{t_0}^t \mathrm{d} t_2 \int_{t_0}^{t_2} \mathrm{d} t_1 \hat{H}_I(t_2) \hat{H}_I(t_1).$$
Now you can rewrite the final integral by reading it as a surface integal in the ##(t_1,t_2)## plane. Instead of integrating over ##t_2## first you can as well integrate over ##t_1## first (just draw the triangular integration region!)
$$\int_{t_0}^t \mathrm{d} t_2 \int_{t_0}^{t_2} \mathrm{d} t_1 \hat{H}_I(t_2) \hat{H}_I(t_1) = \int_{t_0}^t \mathrm{d} t_1 \int_{t_1}^{t} \mathrm{d} t_2 \hat{H}_I(t_2) \hat{H}_I(t_1).$$
We always have to keep to Hamiltonian with the smaller time argument to the right. Now we rename the integration variables on the right-hand side of the equation and in another step use the time-ordering operator:
$$\int_{t_0}^t \mathrm{d} t_2 \int_{t_0}^{t_2} \mathrm{d} t_1 \hat{H}_I(t_2) \hat{H}_I(t_1) = \int_{t_0}^t \mathrm{d} t_2 \int_{t_2}^{t} \mathrm{d} t_1 \hat{H}_I(t_1) \hat{H}_I(t_2)= \int_{t_0}^t \mathrm{d} t_2 \int_{t_2}^{t} \mathrm{d} t_1 \mathcal{T} \hat{H}_I(t_2) \hat{H}_I(t_1).$$
Since we can also write a time ordering operator in front of the operator product on the left-hand side, we can just add the two equal integrals and divide by ##2##, leading to
$$\int_{t_0}^t \mathrm{d} t_2 \int_{t_0}^{t_2} \mathrm{d} t_1 \hat{H}_I(t_2) \hat{H}_I(t_1) = \frac{1}{2} \int_{t_0}^t \mathrm{d} t_2 \int_{t_0}^t \mathrm{d} t_1 \mathcal{T} \hat{H}_I(t_2) \hat{H}_I(t_1).$$
This argument you can now iterate further, and finally you get as a formal solution of the eom
$$\hat{C}(t)=\mathcal{T} \exp \left [-\frac{\mathrm{i}}{\hbar} \int_{t_0}^t \mathrm{d} t' \hat{H}_I(t') \right].$$
Here you have to expand the exponential in its power series, giving each integral in the power another name of the time-integration variable, then the time-ordering symbol makes sense. The general correction of ##N##th order thus reads
$$\frac{1}{N!} \left (-\frac{\mathrm{i}}{\hbar} \right)^N \int_{t_0}^t \mathrm{d} t_N \int_{t_0}^t \mathrm{d} t_{N-1} \cdots \int_{t_0}^t \mathrm{d} t_1 \mathcal{T} \hat{H}_I (t_N) \hat{H}_I(t_{N-1}) \cdot \hat{H}(t_1).$$
The Green's function becomes important in evaluating these integrals because of Wick's theorem for vacuum expectation values (see any QFT textbook).