Can it tell you the distance? RSSI is received signal strength indicator. This will only ever be db measurement which could also subject to the Fresnel effect by lots of things, walls, windows e.t.c. There are interference issues such as microwaves e.t.c.
If you want to estimate accurately you actually have quite a complete calculation. The following is an example website which does this calculation.
Wifi Range Calculator
Perhaps you could use latency but you're measuring latency against the speed of light over a short distance so I doubt the clock would be accurate enough.
Taking a scientific approach would measure the db at various distances and plot a strength v distance curve and then create formula which closely follows the curve.
Personally I think you need a mathematician to explain the calculation before working on the code.
The alternate option which considering time spent might actually be cheaper, would be to by a GPS locator.