Essentially, everyone who has posted previously is correct on all points - you can't combine two promotions - unless you get a truly magical CM who manages to pull it off despite Disney policy. While that might technically be possible, I can't remember anyone posting here that it happened to them.
Secondly, determining which discount is better (40% or Free Dining) is up to each person/family. In general, those who say 40% is better if you are staying at a Deluxe and Free Dining is better if you are at a Value are probably correct. If you are staying at a Moderate, it is sometimes a little harder to determine which deal is better.
What you need to do is look at your current ressie at the 40% off - if you haven't already added the Basic Dining Plan, do so now. Look at that as a total cost. Then, go to the Disney general reservations website, and book the identical vacation WITHOUT the dining plan - making sure you retain the same dates, room and ticket options. This would be your cost (rack-rate) with Free Dining. Compare that total with your current ressie - only then will you be certain which one is better.
Just as an example - although we didn't get a 40% code - our family is hoping to go in late Aug. to early Sep. for 8 nights in an ASMu Family Suite with 5 Day Hoppers and the Dining Plan. Rack Rate for the Suites is $184/night. This is for a family of four - two adults and two children in the 3-9 age range. The total cost of Free Dining was (if I remember correctly) about $50 more than if we could have booked with the 40% off and paid for the Dining Plan. So, with that family distribution for a roughly one week vacation, 40% is better if the room rack-rate is (rough estimate) more than $175/night. Free Dining would be better if the rack-rate is less than that.
During Value Season (the only time Free Dining seems to come up), that would tend to support the concept 40% is better on Deluxe, Free Dining is better for Values, and it will depend on your room "view" type for Moderates - although the difference there (like our $50 difference) would be minimal.\
I hope that helped.