An with the meaning of “If” is rather like Schrödinger’s cat – it both exists and does not exist at the same time.
Etymology: Variant of and conj.1 with loss of final d
An apparently isolated earlier (Old English) example of an for and is probably no more than a scribal error of haplography.
An=if does not exist in Old English, in which if=gif and this was later rendered ʒif (and various other spellings) in Middle English, What Middle English did have was “and” that was used to introduce a conditional.
Old English had occasional on (shortened < ond , variant of and conj.1); compare:
eOE Bede Glosses (Tiber. C.ii) in Archiv f. das Studium der Neueren Sprachen (1917) 136 292 Recente memoria calamitates [read calamitatis] et cladis : neowre gemynde earfeðnisse on waele.
[...] the written form an is very rare [as the common conjunction] in printed sources except in representing regional or nonstandard use (where it is usually spelt an').
In sense of [and if – see OED 2. below] the form appears occasionally in the dramatists in the early modern period, especially before it , as an' 't please you , an' 't were , etc.
But this is no more than contractions, not the invention or introduction of a new word or the resurrection of an old one:
Modern writers and editors have frequently elaborated on this practice, making a conventional distinction between the two forms. For instance, except in an' 't, an is found only once in the First Folio, and being the usual spelling in the conditional use, but later editors of Shakespeare's works have frequently changed the spelling of the word, when it occurs in this sense, to an.
2. Now usually in form an. = and conj.1 II. (conditional). Formerly also in † an if, † if an (obsolete). Now archaic, literary, and regional (Scottish and English regional (chiefly northern)).
c1400 (▸c1378) W. Langland Piers Plowman (Laud 581) (1869) B. ii. l. 132 And myȝte kisse þe kynge for cosyn, an she wolde. [My translation/paraphrase "And if she wanted to, she would kiss the king"]
a1698 F. Sheppard Cal. Reform'd in Duke of Buckingham et al. Misc. Wks. (1704) 221 This over-grown Beast here, an't please your Highness,..calls my Valour in Question.
1928 A. E. Pease Dict. Dial. N. Riding Yorks. 3/1 An ye see ooer John ye mun tell him. [My translation "And if you see our John, you must tell him.]
But the prize for popularising the myth “an = if" must go to Charles Kingsley and the 1850 quote:
B. n. = and n.1 1. Chiefly in plural in ifs and ans.
?1697 in William & Mary Q. (1939) 19 350 If he promises any favour..it is with so many ifs and ans that he seldom fails of finding a backdoor, to evade all his promises.
1850 C. Kingsley Alton Locke I. x. 149 ‘If a poor man's prayer can bring God's curse down.’.. ‘If ifs and ans were pots and pans.’
The latter is a dialect recitation of “if ifs and ands were pots and pans, there'd be no work for tinkers' hands.” Which According to Oxford Reference arose in the mid -19th century.