When placing M&Ms into your unbaked cookie dough, you can't really predict how they are going to look after it's done baking. I normally don't care too much about that, but if you do, there's an easy solution! Mix about 80% of your M&Ms into your cookie batter and keep the rest for later. Then, as soon as your cookies are done baking, just press your M&Ms into the soft cookies where you want them. Make sure to do this right away and to not over cook your cookies.