Great question indeed. At first Eugene Seidels answer seemed right to me but then I checked how I say it and there is no difference... war'n actually feels faster as the "liaison" is easier to pronounce.
Without any sources to back this up, I will theorize that the rule might be as follows:
When you shorten the definite article then no space (auf'm Berg, unter'm Sofa, hinter'n Mond); case doesn't matter
When you shorten an indefinite then use a space
Also, there e are not comparing the same thing in the question. Mit is a preposition while war is a verb. So the situations are different which by itself might account for the difference in punctuation. However, I want to tie this together with the first part of my answer.
If people shorten an indefinite article after a preposition they usually go for 'ne/n/m/r. So the occasions where mit'm is a shortened mit einem are rare.
After verb on the other hand a definite article is rarely shortened I think. People would use the definite one for a reason so as to refer to something. So it has some significance and is hence somewhat protected from being shortened. So... after verbs we will usually see shortened indefinite articles and there they can very well be reduced to just one letter.
As I said... I have absolutely no source to back this other than my native powers.
Wie du's haben willst.
andSo 'n Blödsinn!
==> Duden.de – gamag May 28 '13 at 19:11mit'm
is interpreted as one expression (although consisting of two words) similar to can't or don't whilewar 'n
is interpreted as two words. I can't imagine that anyone would bother if you wrotewar'n
... (that's of course only an opinion) – cgnieder Jun 12 '13 at 10:29