We have $$f(x) = (x - p)^2 - q$$, $$q > 0$$, and $$a_1, a_2, a_3, a_4$$ in AP with mean $$p$$ and positive common difference $$d$$.
Since the four terms are in AP with mean $$p$$, we have $$\frac{a_1 + a_2 + a_3 + a_4}{4} = p$$.
We may therefore set $$a_1 = p - \frac{3d}{2}$$, $$a_2 = p - \frac{d}{2}$$, $$a_3 = p + \frac{d}{2}$$, and $$a_4 = p + \frac{3d}{2}$$.
Substituting into $$f$$ gives $$f(a_1) = \left(\frac{3d}{2}\right)^2 - q = \frac{9d^2}{4} - q$$, $$f(a_2) = \left(\frac{d}{2}\right)^2 - q = \frac{d^2}{4} - q$$, $$f(a_3) = \left(\frac{d}{2}\right)^2 - q = \frac{d^2}{4} - q$$, and $$f(a_4) = \left(\frac{3d}{2}\right)^2 - q = \frac{9d^2}{4} - q$$.
Since each of these values has absolute value $$500$$, we obtain $$\left|\frac{9d^2}{4} - q\right| = 500$$ and $$\left|\frac{d^2}{4} - q\right| = 500$$.
Because $$q > 0$$ and the two expressions must both have absolute value $$500$$ with different inputs, they must have opposite signs (otherwise $$\frac{9d^2}{4} - q = \frac{d^2}{4} - q$$ would force $$d = 0$$, contradicting the positive common difference).
Thus we consider the case $$\frac{9d^2}{4} - q = 500$$ and $$\frac{d^2}{4} - q = -500$$.
Subtracting the second from the first yields $$\frac{9d^2}{4} - \frac{d^2}{4} = 1000$$, which simplifies to $$2d^2 = 1000$$ and therefore $$d^2 = 500$$.
Substituting into the second equation gives $$q = \frac{d^2}{4} + 500 = 125 + 500 = 625$$.
Hence $$(x - p)^2 = q = 625$$, so $$x - p = \pm 25$$ and the two roots are $$p + 25$$ and $$p - 25$$.
The absolute difference between the roots is $$50$$, and therefore the answer is 50.