1999 Toyota Corolla Engine Rattle: engine kept running when in "off" position

My wife's car recently experienced some strange symptoms that disappeared, but we're not sure what it was. After going to the store,
she got back in the car and started it up. She heard what she thought was shopping carts rattling nearby. After backing out, she realized it was the car and re-parked. She turned the engine off, but apparently the engine kept running. She got worried and put the emergency brake on and pulled the key out of the ignition, which made the engine stop.
She called and told me her car was rattling, so I told her to add a quart of oil to see if that helped (and if it didn't, I'd come get her). After this, the engine started without a rattle. I checked the oil later, and it's actually a little above full now, so I don't think low oil was the problem. It sounds like something on the electrical side, like electrical distribution or the computer...
Anyone have an idea about what that might be?
Thanks in advance for any advice, Dave
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Diagnosis would be a little easier if a check engine light came on.
It sound like a problem with ignition timing, but the best way to accurately diagnose is for a trained technician to experience the condition.
--

Ray O
(correct punctuation to reply)
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Motorsforum.com is a website by car enthusiasts for car enthusiasts. It is not affiliated with any of the car or spare part manufacturers or car dealers discussed here. All logos and trade names are the property of their respective owners.