Let's do a little math. Let's assume a 50-50 MR-LR mix, with a $50k ASP MR and a $62k ASP LR (now that much of the lower end will be going down to the MR). Margin in Q4 is supposed to be 20%. So
0,5*MR_margin + 0,5*LR_margin = 20%
MR_margin = ($50k - MR_base) / MR_base
LR_margin = ($62k - LR_base) / LR_base
LR_base = MR_base + $2k
Solving, I get:
MR_base = $45,6k
LR_base = $47,6k
MR_margin = 9,6%
LR_margin = 30,3%
I'm willing to bet that MR base is actually right about $45k, aka basically zero margin. And $5k of options makes it 10% margin.
Since the MR pack is a LR pack with some cells missing, the pack cost won't be optimal for the capacity (more structure than needed).
However, Tesla once hoped to get cell costs to be down to around $100/kWh by the end of the year (optimistically, assuming various supply costs, etc). Let's optimistically/pessimistically (depending on your point of view) say they're $130 now, and assume MR is 20% smaller (which conveniently lets Tesla build a 5th MR for every 4 MRs, vs LRs). For nice easy math, we'll call the LR pack 80 kWh, which makes MR 64 kWh, a difference of 16 kWh. 16 * 130 = $2080 reduction in cell cost. Oh no, MR pack costs more per total kWh! Except that this assumes LR pack is built with zero margin.
Instead, let's look at it from the other direction. If SR is "50kWh" and making a naive but conveniently simple assumption that the 50/75 ratio of marketing (not actual) battery sizes gives us the true size, SR is 53.33... kWh. Let's round that down to 53 so we don't have annoying repeating decimals. 53 * 130 = $6890 for SR base cell cost. 64 * 130 is $8320, and 80*130 is $10400. So that means a MR customer pays $5000 for $1430 of additional cells (difference in cost is likely a bit higher from SR to MR/LR due to optimized cheaper packaging), and LR customer pays another $4000 for $2080 ($9000 for $3510) cells on top of that. This is still just cell cost, but for MR and LR the additional pack costs are identical as the MR is just a LR missing cells.
So the margin on cells relative to SR, for MR is $3570 or 40%. LR relative to SR is 39%. LR relative to MR is 52%, but in total they would make marginally more *per cell* sold to customer with MR vehicle. Combine that with MRs lower cell use per vehicle alleviating the cell bottleneck, and allowing more packs and thus vehicles to be built (and lowered starting price meaning more high margin option uptake, etc), and it makes a lot of sense to build the MR. You can fudge the numbers around but for any reasonable assumptions margins will be pretty close for the incremental cost of MR vs LR over SR.
On cell costs alone, the MR should have a higher margin than the LR to start with. The LR brings in more dollars, but the margins will likely be a close tie (depending on exact ratio of cells in MR and LR, as above with my easy math assumptions above), which means that building more vehicles faster before end of Q4 lets them sell more high margin upgrades to more people (EV incentive) plus also gets / keeps the production rate higher (so fixed costs get spread around more vehicles, margins on everything go up)
Now to guess at base costs:
Assuming pessimistically the $35k Model 3 requires $100 kWh cells to be break even (vs some 10% or such margin), and pretending pack costs are the same on SR (they'll be lower, but it saves us figuring out what the difference is there), then SR cell costs $5300, and everything else (including pack structure, electronics, etc) is $29700. That would make MR base cost at zero margin with cells at $130 be $38020, and LR would be $40100. That's quite a bit below your assumptions of base costs.
To get to your assumptions on base cost from an asssumed $100 kWh break even for SR, would mean the current cell costs are in the neighborhood of $250 (your MR base price) - $220 (your LR base price).
If,
in the middle of this year, Tesla thought they would even possibly hit $100kWh/cell around the end of 2018, I don't see how their current costs could be anywhere near your assumptions. Even if they were at $175/kWh at cell level now, that would still only be $40900 and $43700 for base costs, which would mean MR requires PUP to break even (but only barely) and LR RWD just breaks even without PUP. To get to only 20% margins from there across the ASP you have to be pessimistic about the margins on options or ASP itself.