it is hard to test this without the data, however, I think what you may be looking for is defining the "state". Either you can set it in your script using cmd.set('state', x) or define it in the get_distance function. Since you use state=0, it will always use the object's current one. In your loop you could use i+1 or numarray[i] for this, depending on the order of the states (I assume it starts with 1, i starts with 0).
from pymol import cmd # you won't need to write pymol.cmd. further down
f = open("twoD_dist_ang.txt", "w")
for i in range(0,len(numarray)): # I assume numarray is a defined list containing numbers?
cmd.reinitialize() # I'm not sure you need to reinitialize PyMOL every time, you could use cmd.delete('all') if you want to get rid of objects
ang=cmd.get_angle(atom1="179/C",atom2="206/N",atom3="996/N",state=numarray[i]) # skip the str() formatting for later
f.write('%.3f\t%.3f\t%d\n' %(ang, dis, numarray[i])) # format using %f syntax, %.3f gives you 3 digits
If you want to go through the states of the object you can use a loop:
for state in range(1, cmd.count_states('topo')+1):
cmd.set('state', state, 'topo')
# and so on
Hope this works out, you could manually control check if the script is doing its job correctly.