If you seek an explicit calculation for the kinetic energy of a particle with a delta potential, you can look at chapter 2.5 (I think) of Griffiths or check the wikipedia article. It is a well known result and we directly use it in the lecture notes.
BTW: The given |n\rangle has a wrong normalization factor; it should be \sqrt{\kappa}, fixed it now.
First part:
Calculation for derivative
(https://math.stackexchange.com/questions/2432987/how-do-i-calculate-derivative-of-sgnx):
\phi(x)=\sqrt{\kappa}\,e^{-\kappa |x|}.
\frac{d^{2}\phi}{dx^{2}}
=\kappa^{2}\phi-2\kappa\sqrt{\kappa}\,\delta(x)
=\kappa^{2}\phi-2\kappa\,\phi(0)\,\delta(x).
So
\begin{aligned}
\langle T\rangle
&= -\frac{\hbar^{2}}{2m}\int \phi(x)\,\phi''(x)\,dx \\[6pt]
&= -\frac{\hbar^{2}}{2m}
\left[
\kappa^{2}\!\!\int \phi^{2}\,dx
-2\kappa\,\phi(0)^{2}
\right] \\[6pt]
&= -\frac{\hbar^{2}}{2m}
\left[
\kappa^{2}\,\underbrace{\int \phi^{2}\,dx}_{\displaystyle =1}
-2\kappa^{2}
\right] \\[6pt]
&= -\frac{\hbar^{2}}{2m}\,[\kappa^{2}-2\kappa^{2}]
= \frac{\hbar^{2}\kappa^{2}}{2m}.
\end{aligned}
\implies \langle n|H_n|n\rangle
= \langle T\rangle + \langle V\rangle
= \frac{\hbar^{2}\kappa^{2}}{2m} - \lambda\kappa
= \frac{\hbar^{2}\kappa^{2}}{2m} - \frac{\hbar^{2}\kappa^{2}}{m}
= -\frac{\hbar^{2}\kappa^{2}}{2m}
\equiv \epsilon_0 \text{ (in the lecture notes)}.
Second part:
What we are doing is the following:
\int_{-\infty}^{\infty} (\cdots)\,dx
= \sum_{\text{cells}}\int_{0}^{a} (\cdots)\,dx
= N\underbrace{\int_{0}^{a} (\cdots)\,dx}_\text{cell} ,
where L=Na is the length of the system. Now what we are interested in is the integral over each individual cell, because (again) this quantity has all the information as this quantity is related to the energy bands and other observables. We are not actually interested in the total integral, as when we think of an infinite lattice, this integral over the crystal will diverge. So yes, the wavefunction is defined over the entire lattice, but we do not focus on the entire space when integrating.
(Now note that you can also drop the N factor and just consider the integral over one unit cell and renormalize the wavefunctions to get the same result).