Gravity does affect itself. What you've just given is basically a correct argument for the fact that general relativity must be a nonlinear theory.
Gravity is energy, right?
Gravity has energy. For example, the mass of the earth contains a negative contribution from its negative gravitational binding energy.
In more detail, here is an argument to the effect that general relativity must be nonlinear.
As a concrete example, when the earth condensed out of the primordial solar nebula, large amounts of heat were produced, and this energy was then gradually radiated into outer space, decreasing the total mass of the earth. If we pretend, as in the figure, that this process involved the merging of only two bodies, each with mass $m$, then the net result was essentially to take separated masses $m$ and $m$ at rest, and bring them close together to form close-neighbor masses $m$ and $m$, again at rest.

The amount of energy radiated away was proportional to $m^2$, so the inertial mass of the combined system has been reduced from $2m$ to $2m+\delta$, where $\delta\sim -G/c^2r$. The reduction in inertial mass due to radiation in this scenario is in fact almost exactly identical to the result of the thought experiment used by Einstein in his original paper on $E=mc^2$. Based on the equivalence principle, we expect that this reduction in inertial mass must be accompanied by an equal reduction in the gravitational mass. We therefore find that there is a nonlinear dependence of the gravitational field on the masses.
This nonlinearity is incorporated into general relativity in the Einstein field equation, which is a nonlinear differential equation.