The picture above is the block diagram of an echo filter. My question is, how does the delay, and gain block affect the output signal? I think that when the input signal is outputted with a delay from when the user and a smaller amplitude.
Without the attenuation compensation block the output of your echo filter can be written like:
$$output = input + delayed~ input × gain$$The delay block delays your input signal by a specific number of samples and then the delayed signal is multiplied by the gain ($gain<1$ due to losses in the echo path). So you are basically adding a delayed version of your original signal to the original signal.
The output is the sum of the input and a scaled and delayed version of the input
$$y[n] = 2 \cdot (x[n] + 0.8 \cdot x[n-4000])$$
The multiplier of 2 seems a little suspicious. Divide by 2 (or multiply by 0.5) would make more sense.