I don't know what's in Trump's head, but IMO, a debate with Bernie helps Trump by putting pressure on Hillary. A debate would elevate Bernie's standing with the public. Subconsciously, Bernie becomes the opponent, not Hillary. The debate would also illuminate similarities (both Trump and Bernie being more or less "outside" the NWO club) and differences between the two of them, and those differences carry forward to the general no matter who the DEMs nominate.
On the conditional aspect, I don't know how negotiable that is with Trump. He's suggested the same thing in GOP debates, and justified the request on ratings improvements that the networks should not get a windfall out of.
My question is why debate Sanders at all? Can you hear the #NeverTrump’s next chapter: He can’t even win a debate against Sanders.
I guess I’m missing something.