1998 camaro Z28
manual trans, 185k miles

my check engine light has been on for a while but the car has driven fine until tonight. when the ses light originally came on i checked the codes and they were:
P0405- EGR flow sensor- A circuit low input
P1404- Manufctr control Aux emission controls

As i said the car has been fine for months but today when i started it after work it cranked very slowly and was idling high. i turned it off and back on and it was ok. then, this eve when i was heading home from my gf's it cranked very slowly again and started but idled way high and when it dropped back down close to idle i reved it to about 3k rpms and it stayed there for nearly 10 seconds. i did this a few times and had the same result. i shut if off and started it again and the same thing happend. did this maybe 3 times and shut it down again. finally, i cranked on it again, it turned over very slowly, and it started and idled normally. when i got home i shut it down and then it wouldn't start again. just got the clicking sound. tried jumping it and got nothing. sorry for the long post but i wanted to be very detailed. any thoughts would be very appreciated.