The best way to go about an explanation is an example.
Imagine if the times would go back, when we were living in Baghdad, when all was quiet and mellow.
"Ooo Peace! O God O God. If only we can relive a day."
In Arabic, O peace translates to (يا سلام) (ya salam). However, here there's an elongation in the way it's pronounced (yaa salaaaam). This adds emotion with a couple of nods and a circular gesture of the hand.
Here it means, O beautiful/great if that be/if that happen.
It's like when peace has just come and one looks into the horizon and warm-heartedly says, "O peace, lovely peace."
It's also for example:
Ya salaaaaaaam (O peace). What a lovely soup.
It's sort of an intensifier with the elongation.
It's used in many cases: yearning, something pleasant you hear (poem etc), you watch, you eat. Anything that arouses affection and emotions. Just imagine that moment when peace is finally there.
It can also be used satirically:
Ya salaaaaam. Yeah That's great, wonderful, amazing.
I hope it's understood.