Knowing the time that elapsed before the echo was returned and the speed of sound, you should be able to calculate the round trip distance of the emitted click. If the bat were not moving, this distance would be twice the distance between the bat and the wall, say 2D.
But the bat was moving, flying at a constant speed. Knowing that speed along with the time that elapsed before the echo was returned, you can determine how much distance the bat traveled before receiving the echo. If you call that distance d, then the round trip distance of the emitted click is 2D-d, and the bat is D-d meters from the wall when she receives the echo.