Get the M3. I just picked up an 09 M3, 13k miles, 2 years of the original warranty with an additional 2 year / 100k mile BMW warranty and BMW extended maintenance for 53k including tax.
A new 2011 335is is more than a used 09 M3 last time I checked. And it will depreciate much quicker than the used M3. Even factoring in the increased gas costs and marginal increase in insurance premiums I still think you would come out ahead with the M3 depending on how many miles you drive.
I disagree with the "don't get the M3 if you're not going to race seriously or go to the track comments." The M3 is a luxury sports car, both cars are a far cry from dedicated track cars. You'll have much more fun on the track in something lighter and cheaper.