I would consider "dammit", "damn it" and "damnit" all to be acceptable. As soon as you leave "damn it" you're in slang territory anyway, so personal variations are acceptable.
(I will also accept "dagnammit", "dognarnit" and "magnabbit".)
"(exclamation) Oldcootism used during great consternation or surprise. Used by 1890’s prospectors, cantankerous old farmers, and young people playing old people on TV in the ‘60’s and ‘70’s."
The period inside the quotation marks isn't clear-cut. Standard American usage is punctuation inside the quotations and is a hold-over from practical considerations of typesetting. Standard British usage is punctuation inside only if part of the quotation itself, outside otherwise. The British style also sees some use in scientific and technical contexts even in the USA, due to being regarded as more logical.
run4yourlives being a programmer as well as, apparently, Canadian, is perfectly entitled to use the more logical British style without regret or hesitation.
Strunk and White say that punctuation goes inside the quotation marks regardless of the context (except for question marks and explanation marks), so if you are listing quotes, then the comma goes on the inside of each quote. On a side note...The serial comma (the last one in a list of items) is most certainly needed (imho?).
3. Use a pair of commas in the middle of a sentence to set off clauses, phrases, and words that are not essential to the meaning of the sentence. Use one comma before to indicate the beginning of the pause and one at the end to indicate the end of the pause.
I was with him until he said, "I could care less."
Couldn't, dammit, COULD NOT. This irks me to no end.
http://owl.english.purdue.edu/owl/resource/577/01/
http://www.urbandictionary.com/define.php?term=damnit
http://dictionary.reference.com/browse/dammit