As far as maintenance costs, consider that the additional 2 yrs costs $2095 on new 335i's, $3295 on the M3, so figure about an extra $600/yr for the M3.
If you can afford it, the M3 is a much more refined, high performance car. IMO there's nothing you can do to the 335 to recreate the feel of a high-revving V8, the steering, better transmission, suspension, etc. Yes, you can make the 335 faster, but to me the M3 is in a different league. I had a 335 for 3 yrs prior to getting our M3 in November.