The M3 does everything better than the 335 with the exception of gas mileage.
I ran JB3 and DCI in my 335i. It was probably about as fast as my stock M in a straight line, but the driving experiences couldn't be any more different. The M feels much more solid. I don't know how they did it, but despite handling better it also rides a bit better. The M3 is a much more emotional car to drive - the sound of the engine is irreplaceable.
You really have to drive both to see which makes more sense, but I can tell you right now that if you only care about straight line acceleration or gas mileage, I'd say stick with a 335. Otherwise I'd give the M a close look.
Absolutely no regrets from me... except perhaps not getting the M3 to begin with.