Hello and welcome to our web page here my name isXXXXX a Certified Volvo Car Expert Mechanic.I'm going to try today to answer your question.
i would try cleaning throttle
and replace idle air control valve
also is good to check for fault codes in system with scanner
most the time idle air control valve or throttle get dirty and sticky and create problem what you describe