We consider the twisted waveguide $Omega_theta$, i.e. the domain obtained by the rotation of the bounded cross section $omega subset {mathbb R}^{2}$ of the straight tube $Omega : = omega times {mathbb R}$ at angle $theta$ which depends on the variable along the axis of $Omega$. We study the spectral properties of the Dirichlet Laplacian in $Omega_theta$, unitarily equivalent under the diffeomorphism $Omega_theta to Omega$ to the operator $H_{theta}$, self-adjoint in ${rm L}^2(Omega)$. We assume that $theta = beta - epsilon$ where $beta$ is a $2pi$-periodic function, and $epsilon$ decays at infinity. Then in the spectrum $sigma(H_beta)$ of the unperturbed operator $H_beta$ there is a semi-bounded gap $(-infty, {mathcal E}_0^+)$, and, possibly, a number of bounded open gaps $({mathcal E}_j^-, {mathcal E}_j^+)$. Since $epsilon$ decays at infinity, the essential spectra of $H_beta$ and $H_{beta - epsilon}$ coincide. We investigate the asymptotic behaviour of the discrete spectrum of $H_{beta - epsilon}$ near an arbitrary fixed spectral edge ${mathcal E}_j^pm$. We establish necessary and quite close sufficient conditions which guarantee the finiteness of $sigma_{rm disc}(H_{beta-epsilon})$ in a neighbourhood of ${mathcal E}_j^pm$. In the case where the necessary conditions are violated, we obtain the main asymptotic term of the corresponding eigenvalue counting function. The effective Hamiltonian which governs the the asymptotics of $sigma_{rm disc}(H_{beta-epsilon})$ near ${mathcal E}_j^pm$ could be represented as a finite orthogonal sum of operators of the form $-mufrac{d^2}{dx^2} - eta epsilon$, self-adjoint in ${rm L}^2({mathbb R})$; here, $mu > 0$ is a constant related to the so-called effective mass, while $eta$ is $2pi$-periodic function depending on $beta$ and $omega$.