If anyone is interested below is what I have experienced and done with the car, maybe it can shed some light on something I haven't tought of. Sorry it's a bit long I wanted to be thorough.
I suspected a boost leak last summer but the car was still mostly reliable then towards fall it stopped idling when warm then before I got around to doing anything about it a bunch of wires all decided to die on me I got a code 31 and the car would die when I hit the gas. Then I rewired the afm and when done I had broken the cps wiring, fixed that and now it starts, idles, and responds properly to pressing the gas pedal. This all sounds fine but as it approaches operating temp the car then refuses to idle and throws the 31 code when it stalls. Its different from before because if I hit the gas it might try to bog down but won't stall, if I tap the peddle gently a few times the CEL goes away and it runs great, until I come to a stop because it wont idle and then on comes the CEL. If I hold the gas peddle down while coming to a stop so that the car won't stall then the CEL doesn't come on and I can continue to drive normally. The car will idle cold with the AFM unplugged but not once warm, same as plugged in, and with it unplugged any touching of the gas stalls the engine which is what I understand to be the correct, and why I find it difficult to believe that the problem is actually in the AFM because when cold it runs very well. If the AFM were bad shouldn't it just not work at all like it did before I redid the wiring?
I'm hoping this week to be able to make a new set of IC pipes, and replace all the small vacuum lines since they have nearly 200K on them and it won't cost me anything so seems like a good place to start, since other than the code all my symptoms according to the tsrm can be attributed to a vacuum or boost leak.
Finished now I hope it was fairly coherent and that it explains why I thought that maybe I was getting the code for a reason other than faulty AFM if any of this makes sense and I might not be stupid please chime in, and if all else fails after I'm confident there are no air leaks I will move onto replacing the AFM.