Pitch estimation using the autocorrelation method
An offset of 20 samples is added as 8 lines above (auto=autocor(21:160)) this offset is cut away from the autocorrelation sequence. In the line you mention, this offset has therefore to be considered.

This is done in order to cut away the first maximum (at time lags around zero) and avoid pitch errors caused by picking a delay value that does not make sense for the task of fundamental frequency estimation.

(By the way, your code does not perform pitch estimation but fundamental frequency estimation. There's a difference between these two terms as pitch relates to a perceptual property of a tone while fundamental frequency is a technical property - Wikipedia on "Pitch".)