If you unfold the billiard trajectory, the question becomes equivalent to this:
* Suppose I have a rectangular lattice, where the unit cell has dimensions $x$ by $y$, and a billiard ball is positioned on a lattice point, which we will call the origin $(0,0)$. For what values of $\theta$ will the ball strike another lattice point $(mx,ny)$, where $m$ and $n$ are even integers?
Does that help?