The Gauss-Bonnet theorem relates intrinsic properties of the surface, properties that are independent of how it is immersed in the ambient space. You will not be able to detect self-intersections this way. I don't have a good suggestion for how to do this detection.