Hello rayzermatic!
It turns out that this is somewhat difficult to do with InfoPath's built-in functionality.
One option is to use a recursive approach: put a rule on the field like this:
Condition: field contains "__"
Action: set field to concat(substring-before(field, "__"), "_", substring-after(field, "__"))
This will repeatedly modify the field until the double underscores are gone, however if this repeats more than the allowed number of rule repetitions (8 in browser forms, 16 in filler forms), the rules will stop executing and the user will see a nasty error.
Another option is to use qRules' ReplaceString command. This is the simplest approach, but requires you to have qRules:
ReplaceString /xpath=/path/to/field1 /string1=__ /string2=_
There is one more option that uses an XML secondary data connection and some tricky rules to carry out the operation. It's a bit time consuming to put together and an example and therefore outside the scope of what we provide for free on this forum, but we can prepare you a sample if you'd be willing to purchase one Qdabra support pack.