I din't check your math, because in any case the code doesn't do what it claims to do. The returned points are not within the given distance of the center, but belong to some square-like area.
To calculate a distance as the crow flies, notice that a cosine of the angular distance theta is
$$ \cos\theta = \cos\phi_0\cos\phi_1\cos(\psi_0 - \psi_1) + \sin\phi_0\sin\phi_1 $$
where Phi and Psi are respective latitudes and longitudes. The greater cosine, the closer points are.
Given a distance d
, calculate cutoff = cos(d/R(2*pi*R))
. For each city in the list apply the above formula. The city is "nearby" if the result is greater than cutoff.