Your code has a mistake regarding the refracted ray. Its
angle of the slope should be
$$\beta=\alpha-\sin^{-1}{\big({\sin{\alpha} \over n}\big)}$$
(although you define $\beta$ as the refracted angle, I find this is the easiest way to fix your code). A minor note about the existence of focus is that only rays which are near the axis are under consideration.
Also, you can try to prove that the focus $f$ is
$$f={R \over 2(n-1)}$$
where $R$ is the radius of the curvature of the lens and $n$ is the refractive index. You already know how to implement the Snell's law, and to prove the equation, you just need to take one more step and use the approximation $\theta \sim \sin{\theta} \sim \tan{\theta}$ when $\theta$ is small (this requirement is satisfied if rays are near the axis). You will find the paraxial rays closely meet at a single point, which is the focus of the thin less.