The letters ver should always ring the compound bell. Also, the prefix gives more insight into the meaning than the straightforward tun (to do):
Among quite a few functions,
can express that something is done wrong. A few examples:
verrechnen (calculate incorrectly, to miscalculate)
verschießen (to waste a shot)
verfehlen (to miss (a target))
verspielen (to gamble away, to squander)
So in combination with tun, it basically means doing something the wrong way (to misdo).
In everyday use, it often goes in the direction of misuse, misplace.
when it's used together with a reflexive pronoun, it means to make a mistake, to err.
In Em1's context, it could be paraphrased as "if I'm not making a mistake in the process of remembering/thinking" or "if I'm not typing/telling you something wrong".
Note that in the cited context, sich irren is more common. Probably because sich vertun has a strong practical connotation.
As to the Yiddish aspect:
According to Duden, vertun already existed in Old High German in the form of fertuon. That goes hand in hand with the relation of tun and tuon.
If it's that old indeed, than it's older than Yiddish.
So one would have to argue that it derives from the Hebrew טעות (taut?, tayt?, tavt?), and that ver- has the positive, attributing, final meanging here, of making sth. into sth., but that seems a rather weak alternative.