ML320 Engine stuttered and stalled while driving. Seniors Pls Advice.

This is my first post. Never realized there was a MB forum and I'd be seeking help someday. I always thought Mercs were rock solid and would never fail, well unless one deliberately mishandles them off course. So here I am with a situation as titled.
Model: ML320
Year of make: 2002
Kms run: 160,000 Kms (not miles)
Condition: Well maintained / timely serviced
Problems before: None ever
I return from vacation (two months) and find my "Check Engine" light 'ON'. The keys were with a friend who used to start it once a week and idle it/run it for a while, so the battery wasn't dead.
Drove it to the local grocer and for other errands. Thought would visit the dealership after taking an appointment. Especially since my regular service was due - and would fix it in one visit (bad choice).
On the way back I could feel the engine was not revving up as it should. Pick up was poor, very poor. Upon throttling (a bit hard I now understand) the car just started shaking violently. It was like what-the---!!! Never in my life that happened with any of my cars, it was like the engine would fall-off anytime. I was seriously scared. So I pull-over and stop. Get hold of my senses - and start the car again (maybe after ten odd minutes). It starts fine. I drive towards my home.
Ten minutes into it - the car starts to act up again. Same vibrating engine, 'check-engine' light ON and I can hear 'knocking' sounds coming from the drive train. I am just nearing my home, take the turn (thus slowed the car) and the engine sputters and dies. Check engine light now "blinking".
I am in heavy traffic. With a car half on the main road. I try to restart - it won't. Tried couple of times - no joy. A good samaritan assists me in pushing the car till it is safely parked in the sideway. I walk home, physically and mentally shattered, how could my lovely Mercedes do this to me!
I take some rest, a long break - and return back to my car in the evening. I start the car - it fires well - runs for a minute then 'check engine' light blinks - and it shuts down. Flashes "Start Error". Try many times - same issue. And while the engine is running I could hear "knocking" sounds from it - as if it s a heavy diesel engine.
I fetch my local mechanic (he has a big garage and is quite handy at times). He runs thru the diagnostics (some gadget in his hand) - tells me there are multiple error codes - and the car is now 'totalled'. I should send it to the scrap yard. It is beyond economical repair it seems.
So my friends, can you pls tell me is that so? Should I 'can' the car, or is it worth reviving?
B'coz if this is a heavy repair job (like engine remodelling) - it might not be worth the time, efforts and money.
However, one thing I don't understand tho - How? How a well maintained Mercedes, within 160,000 Kms (note kilometers - not "miles") could have an engine breakdown?
Thanks for reading this long post buddies. Any advice? I haven't called the dealership yet. Thinking - should I fix it or call the scrap dealers.
Start Error could be a few thing but you will have to have the codes read. Why didn't you ask him what the codes were?
In any event you should have a scanner of your own.

Checked with my friend, and oh yes, he did jump-start the engine once. But later on it used to start normally. Btw, he never noticed the 'check engine' light glowing. Prolly b'coz he is not used to driving this car. He drives a Corolla.
So, in your opinion, as I understand, it is not a major fix, right?
Now, would you also be kind enough sir to advice me what actually could be the problem/s? Broadly, if not specific.
Thank you.
Ps.: Thanks for the link. I'll surely invest in one.

Yes, I do have another key ~ and I'll try that today.
Ps.: Searching for an appropriate Diagnostics Scanner since the linked one is OOS (out-of-stock).
Trending Topics
The Best of Mercedes & AMG

I didn't forget. Received my car back today after a month in the garage, here's all that has been done:
As of now things are back to normal - and the vehicle is running fine.
Ps.: The figures are in $CAD


