On your Instant Pot®, select Sauté Low. When the display reads “Hot,” add the oil and heat until it shimmers. Add the onion. Cook for about 2 minutes, stirring frequently. Turn off the Instant Pot® and stir in the garlic and asparagus, cooking for 30 seconds.
Add the stock, rice, peas, thyme, salt, black pepper, and red pepper flakes, stirring well. Lock the lid and turn the steam release handle to Sealing. Using the Manual or Pressure Cook function, set the cooker to High Pressure for 8 minutes (7 minutes at sea level).
When the cook time is complete, quick release the pressure.
Carefully remove the lid and stir in the butter, lemon juice, and spinach, being gentle so as not to tear the snap peas. Taste and season with more salt, as needed.