Two point function or Feyman propagator of K-G field G_2=D_f (x)=theta(t)D(x)+theta(-t)D(-x) describe the amplitude of particle propagating from 0 to x on spacetime, which is just say for the observation we can't distinguish the particle move from 0 to x and the antipaticle move from x to 0 along -t and so we have to take the sum as final result.
On how to write G_2 in a single integral which contains a iepsilon (epsilon>0 and is infinitesimal), it's merely a mathematical trick. The simplest way is to check D_f(x) on 4-momentum space whether equal to the form in terms of D(x) by calculating the energy integral in the D_f(x), which is essentially the treatment in Peskin's QFT book (here you have to make the choice of countor in order to identify the two expressions, and note that epsilon^2=0, 2epsilon E_p shall be taken as epsilon due to infinitesimal, so p^2-m^2+iepsilon=(p^0-E_p+iepsilon)(p^0+E_p-iepsilon)).
You can also take an integral representation of theta(t), here obviouse we have theta(t)=int domega e^{iomega t}/[2pi i(omega-iepsilon)], where the integral contour c=infinite semicircle on upper half plane, t>0 or lower half plane, t<0. This integral indeed equal 1 if t>0 and 0 if t<0.
Substituting above integral, it's directly to get the usual propagator as an integral on 4-momentum space (take D(x) the form of (2.50) in Peskin's QFT book, and move the pole by setting omega=p^0-E_p, p^0+E_p). In a word, the only physical point is the expression of Feyman propagator at first, and the choice of countor is just a way to represent theta(t) or to identify two forms of Feyman propagator.