That flowchart assumes there is a connection between the transmitter and the PIC, and ignores any time delay.
As it is currently wired, you can have the receiver turned on until you hear a sound, then you turn it off for a millisecond(?) then turn it on to wait for another, then turn it off for a millisecond, then turn it back on and wait for a sound, and so on...
So what do you hear? You hear transmitted pulse, echo, transmitted pulse, echo, ...
If you time the delay between hearing the 2 sounds, you can calculate distance.
However, you need to determine which is the transmitted pulse so that you can determine which delay to convert to a distance.
Maybe there is a way to do that. If not, you need another way to determine either which pulse is the transmitter, or when the transmitter sent the pulse. Each method may give slightly different results, and one may be more valid than the other.