Deriving difference equation
Neither of the two equations match with the diagram. It's actually quite straightforward: at the input of the delay you have

$$x[n]+\frac12\big(y[n]+y[n-1]\big)\tag{1}$$

Then a delay of $N$ samples is applied to compute the output, hence

$$y[n]=x[n-N]+\frac12\big(y[n-N]+y[n-1-N]\big)\tag{2}$$

But here I've found a different diagram, which corresponds to the last equation in your question.