Generally, when something goes wrong in an environment in which swearing is frowned upon (i.e. whenever children are present), I resort to a phrase coined by my high school music teacher: "Schmuck in a ditch."
It's arbitrary, random, amusing, and you can get halfway through saying 'shit' before switching to a less obscene option.
In terms of insulting someone, I generally rely on terms such as 'Deeshflat' (once again coined in a Music Theory class), troglodyte--basically meaning caveman--or random strings of adjectives and nouns. I find it to be effective.