Detaching and reflecting is a good practice, especially where swearing is a verbal crutch for yet-to-be-refined thoughts. Give it a moment, dispassionately and accurately frame the thought. In the end, what you say will be much more direct, and far more useful to everybody involved.
Also consider swears like farts in a relationship. A well-chosen place and time, dropping one is hilarious. All the time though, you just stink.
Have you tried using made-up or downgraded curse words? Fracked, frelled, dren, sparks, slontz, gorram, jagweeds, cheese&crackers, crackers&toast, etc?
It will probably make you feel silly, but you can meditate on it being literally no sillier than using actual curse words to pepper your ordinary speech.
If you are serious about not being able to not curse if you get excited you may be better off talking to a psychologist than asking the internet for advice.
I do have the same issue, but since I work in corporate, I have to think about everything I say or write within company. I still do curse a lot when communicating within closest people in my team(which are mostly developers) and noone minds. We even share the hate for the corporate forced politeness together with some.