Hey mate - check all your grounding - make sure they are clean and firmly in place, my mates 180sx had a similar issue (I know its a different car - but from memory the auto trans is from the same family) with the trans always going into limp mode intermittently. My mate brought his car to an auto electrician for another un-related issue and the auto elec found out one of the grounding wires was not connected/possibly came loose. Since then no trans issues with what so ever, best 5 minutes spent....
Also check for chaffed wires, which could cause shorting.
Hope this helps.