"Черта с два!" This colloquialism is obsolete now. It's become literal. You can find it mostly in novels of Russian authors. I use it very rarely.
Speaking of its origin, I'd rather say that when one mention a devil he means rude and complete rejection. It's similar to English answers: "Go to hell!" or "I'll do it when hell freezes over".
Reference to number 2 is used to strengthen rejection. Even numbers were supposed to be devil's numbers. That's why "two devils" is more emotional than simply "devil".