Hi mate,
it seems to me like you having a issue with your IAC ( Idle Air Control ) valve. take it out from the throttle body & clean it with TB cleaner & place it back carefully. erase the memory by pulling the memory backup fuse or disconnect the battery.. now you are good to go!