I am wondering if the rule that dictates when to use "an" or "a" in sentences is Sandhi? If not, what is it? I'm trying to explain why we use "an" or "a" in English beyond the "An is for vowels, A is for consonants (with exceptions)" because they want to know more about it.
The term sandhi comes from Sanskrit, and means "putting together". It refers to sound changes that result from combining morphemes (including words). Most rules of Sanskrit sandhi do not refer to specific morphemes or categories, but some do. For example, the regular vowel sandhi rules do not apply to the vowels [ī ū e] in dual endings. Other Sanskrit sandhi rules apply in specific contexts (not just being blocked). More generally, if you look at the linguistic literature using the term "sandhi", it generally refers to any sound changes resulting from combining words (and "internal sandhi" is thus a rare usage).
In the case of h-initial words, there is dialect variation in whether underlying /h/ is still there when the a/an rule applies, in case /h/ is at the beginning of an unstressed syllable. This would pose an analytic problem if you believe that optional rules must all follow morphologically conditioned ones -- such a belief was held for a while in Lexical Phonology, via a bifurcation of postlexical phonology into P1 and P2, but that theory has been disproven anyhow, and has been replaced with the theory that there is an autonomous phonetic implementation component which operates continuously and below the level of the segment. If you can establish that /h/ is not actually fully deleted, just reduced in magnitude, then that would be a prime candidate for a rule of phonetic implementation -- and it would be a real problem to have n-deletion apply after this gesture-reduction process. So far, nobody has provided any evidence that h-deletion is other than a regular old categorial phonological rule.
"a/an" is not sandhi in my dialect of American English, because it is no longer phonologically conditioned. Like many, I get "an" before an unstressed syllable starting with "h", which makes sense, because "h" can be dropped at the beginning of an unstressed syllable, and once it is elided, the "an" now comes before a vowel, and so there is no reason for the "n" to be lost. But there is already a problem here, because the loss of "h" is a low level phonological rule, sensitive to speed of speech and style, and you don't expect such a rule to trigger a morphologically conditioned rule like "an" ==> "a" /_C . (It's morphologically conditioned, because "n" at the end of other words does not drop.)
However, the bigger problem is that, for me, "an" is used before an unstressed syllable starting with "h" even when the "h" does not actually drop. That is, I say "a history of France" but "an historical incident" even when the "h" of "historical" is pronounced.
So it appears that the "an" ==> "a" rule has lost any phonological reference. Sandhi rules, however, are phonologically conditioned (though they may have morphological conditions also), so I say that the "an" rule is not sandhi, at least for dialects like mine.