You track? M3 is better
You want a show car? M3 is better
You want a fast DD? 335i is better
YOu want to save 444? 335i is better (a CPO 08 with the N54)
The M3 is a dream at handling... the 335i is great too, but the suspension is not meant for sweepers and sharp turns like the M3 is. Any BMW is more than enough for the streets regarding handling. The M3 is actually more comfortable as well because of the 335i's STUPID STUPID RFT.
I couldn't justify the $20,000+ difference between a 335i and a M3 in 08...specially because I don't track.