Replacement for "God forbid"

Solution 1:

Aside from the phrases "God forbid" and "Heaven (or heaven) forbid" which could be construed to have religious connotations, this site suggests perish the thought. On the entry for this phrase, the site writes:

Don't even think of it. This expression is used as a wish that what was just mentioned will never happen. For example, "He's going to give another speech? Perish the thought!"

This phrase appeared in Handel's oratorio Joshua (1748; text by Thomas Morell): “It never shall be said that our allies in vain implor'd our aid. Perish the thought!” Also see god forbid.

There are further examples here of its use, writing:

If you should become ill—perish the thought—I'd take care of you.

I'm afraid that we need a new car. Perish the thought.

Like "God forbid!", "perish the thought" can be used both parenthetically in the middle of a sentence, and as a phrase more on its own. For your specific example, you could say:

You could do X if, perish the thought, Y doesn't happen.

Solution 2:

Simchona's perish the thought works nicely there, but I might also suggest knock on wood (or touch wood depending on your particular region) which replaces the religious connotation with something closer to superstition. It has a similar feel in that you're trying to ask for some sort of protection from the terrible event you're about to mention.

Solution 3:

I was surprisingly unable to find any reference to this phrase here on EL&U or the internet in general, but since we seem to be pulling at straws here I will offer another possibility:

shudder to think

I'm vaguely familiar with the term, and this was the only reference I could find:

http://idioms.thefreedictionary.com/I+shudder+to+think
I dread/shudder to think
something that you say when you do not want to think about something because it is too worrying or too unpleasant (usually + question word)
He was going so fast - I dread to think what would have happened if my brakes hadn't worked.

Apparently "Shudder to Think" is a rock band, which may have been clogging up my search results. Anyways, I'm not certain this is appropriate usage, but it sounds reasonable to me (albeit not something I would personally care to say):

You could do X if, shudder to think, Y doesn't happen.

In cases where you would use "God forbid" at the beginning of a sentence:

He can't drive. God forbid he gets behind the wheel.

...It doesn't work as well, but it still can:

He can't drive. I shudder/dread to think what would happen if he gets behind the wheel.

Quite a mouthful compared to "God forbid", but it seems this phrase is usually sandwiched between by "I/we" and "what would/could/would have happen(ed) if".

Once again, I'm not certain if the first example is proper usage or not, but if so - it seems to be a decent replacement.

Solution 4:

You could say "Dare I say [it]!" or, "[I] dread the thought!"