Sounds like the MAF (Mass Air Flow) sensor. MAF failure is a common failure on the M104 engines... sounds like this is probably your problem.
It does not bounce in D, but only in P, correct? Test Neutral, it should bounce in that too, I believe. The MAF is the wire connector that attaches to the air intake between the engine block and the air filter.
You can try twisting/unplugging the sensor with the car in Park and see if it makes a difference...
2006 E350 w/ 155k miles (Daily Driver)
1993 300E 3.2L Sedan w/ close to about 300k miles
2003 E500 Brilliant Silver (Had 217k miles when totalled!)
1989 300E with 289,000 miles (had for <1 yr while in HI)
03 CLK 500 cabrio (Mom's)
2006 C230k (Dad's)
1999 S420 (Mom's/Dad's)
2000 C230k Sport sedans
2001 CLK320 Cabrio (Mom's)
1995 C280 My First Mercedes-Benz... (155k miles. EXCEPTIONAL AUTOMOBILE. Was Very hard to let go of!)