No way. Given just a differential, just a pair of connections, there's no way for a circuit to tell which is which.
If you had access to phase information about the grid, you might be able to do it, but as the mains frequency isn't terribly constant, you would not be able to rely on predicting this. Your device would have to get information about the present phase angle of the mains from someplace.
However, if you do have a real earth-ground reference from some place, you could build a circuit to look at the voltage of each supply line with respect to ground. One will be a small drop below the full 120 (or whatever the local mains supply) whereas the other will be slightly above ground. (Neutral return current vs your neutral run's resistance). This would just let you know which leg was 'hot', and you could swap your output polarity accordingly.
A Second Thought
If the power supply has only four connections with the world, two from the mains plug, and two to output the DC, there's no way I can think of that you could deterministically set output polarity based on plug orientation.
BUT
if you're willing to make your otherwise simple supply a lot more complex, you could conceivably make it so that if you pulled the plug and flipped it, and plugged it back in straight away, the output would flip.
Here's the idea: You stuff some kind of micro-controller in the box, that monitors the line voltage, and determines when rising-crossing-zero (or some other phase point) happens on one of the legs. You'd have to reference this to the midpoint of the two supply legs via a voltage divider. The micro could then anticipate when the next such phase point would occur. Now you'd also have to put some kind of super-cap in the box and pick a low power micro that could live off the super-cap long enough for the user to flip the plug. When power comes back, either the anticipated phase change happens when you expect, or half-way between. Half-way between means the user flipped the plug, so your micro flips the output polarity.
Of course, that still would be problematic. If the thing had been unplugged for a while, the micro would be dead, and you'd have to make an assumption about what the output polarity should be. Finding a micro that could last maybe 10 seconds on a cap's worth power while actively chugging away could be easier said than done. Last and not least, this would really only be a novelty gadget.
"Modified Sine" outputs are very bad approximations of AC
This is a capture of the output of an APC 650 recorded by Jesse Kovach, while under load.
Notice the severe over-amplitude events at the extremes (the spikes at top and bottom). In reality they are actually much greater in amplitude, but the oscilloscope in the image was not fast enough to capture it.
Sharp edges in the time domain equate to broad-spectrum noise in the frequency domain. All of this high-frequency content represents additional energy that must be absorbed by protection circuits. If not, it can exceed isolation withstanding limits in the various input stage components and "burn through". If this doesn't burn out the input it will result in a cascading failure where it will cause something to fail on the secondary side from the resulting overvoltage.
...and that's just one failure mode. There are others. Psuedo-sine waves are poor matches to sine-wave inputs. :(
Go DC-DC instead of DC-AC-DC
A much better (and much more efficient!) approach is to go DC-to-DC directly (note: you can't actually go DC-to-DC directly if your input voltage is lower than your output voltage, but the details of this are well contained inside a "DC-DC converter").
Self-contained switch-mode power supplies for Dell laptops that take DC inputs are available in the marketplace. Here's an example:
which I sourced from:
http://www.amazon.com/Adapter-Charger-Dell-Latitude-D630/dp/B002BK7JEC#
Please note that I have no personal experience with this particular product and many cheap DC converters are poorly designed internally. Be careful.
Best Answer
If you have to do this, I would not mess on the Magsafe adapter site.
Instead get one of the commercially available Car charges and there you can slice open the car plug if you have to.
Here is a example of such product
Doing it your way, you will still need a DC-AC-DC step up from 12 to 14.6 Volt. Furthermore you would have to be very careful with the Magsafe plug and the super small space to work with, and the risks involved.