It reads like you need to clean the IAC(idle air control) Valve.
Fuel injected engines can use a regular idle screw, no jets, so the computer operates an air valve located near the throttle plate to allow more or less air into the intake, this sets idle RPMs.
Computer is constantly adjusting it, if it gets dirty it doesn't slide as well and sticks.
It can be removed easily and cleaned, then you can test it before reinstalling by hooking it up to wiring and turning key on and off, computer opens IAC valve all the way when key is first turned on, then IAC valve will close when key is off.
Also clean the air passages on the intake that you will see after removing IAC valve.
Yes, it could be a vacuum leak but they don't tend to be intermittent, it is possible just not as likely for a vacuum leak to cause high RPM and stalling, both.