When diacritics are considered, does the Arabic script have both a
shallow and deep orthography? In other words, do diacritics count as
part of the script?
I understand your question to be: "Is Arabic script a shallow script with diacritics, and a deep one without?"
First, we need to be clear on what you mean by Arabic diacritics. Arabic writing has voluntary diacritics akin to punctuation limited in use to calligraphy and formal presentations of Quranic texts to indicate precise pronunciation, but not used otherwise. There are other diacritics that are now mandatory in normal use to distinguish between similarly shaped consonants, but which were used only in historic scripts and that are now used occasionally only for decorative purposes in representing Quranic text. There are yet other diacritics (tashkil (تَشْكِيل, tashkīl)) that are not used in everyday writing, but can be used optionally as a system and individually to represent precise pronunciation for use in dictionaries, poetry, or children's books or wherever there is a need to disambiguate pronunciations. A subset of these, mostly to indicate short vowels, are called ḥarakāt حَرَكَات. I assume by diacritics, you are referring to the tashkil and/or harakāt.
What I know about orthographic depth is from reading the Wikipedia article on it. In one place, it describes Arabic as having a deep orthography, saying:
For languages with relatively deep orthographies such as English,
French, Arabic[citation needed] or Hebrew, new readers have much more
difficulty learning to decode words.
In another place it describes Arabic as having a very shallow orthography, saying:
Among the tested orthographies, Chinese and French orthographies,
followed by English and Russian, are the most opaque regarding writing
(i.e. phonemes to graphemes direction) and English, followed by Dutch,
is the most opaque regarding reading (i.e. graphemes to phonemes
direction); Esperanto, Arabic, Finnish, Korean, Serbo-Croatian and
Turkish are very shallow both to read and to write
I also see a map online, describing Arabic as having a deep orthography.
I think the confusion stems not only from whether Arabic with or without diacritics is being described, but also from the fact that the basic definition of "orthographic depth" can be applied cleanly to Arabic only with difficulty. As a result, what I will mostly do below is to present the facts of Arabic writing, rather than judge its orthographic depth directly.
Let's address normal writing that does not include tashkil (defined above). Although it is normally quite easy to write an Arabic word uniquely simply upon hearing it, there are many caveats. For instance, as described below, alif can represent three different phonetic realities (/'/, /ā/, and /an/) and two morphophonemic ones (an elided initial /'/ after a prefix and an indication of plurality after a wāw.
More generally, we should understand that the overwhelming majority of short vowels are not indicated in normal writing. Although different root words are normally not distinguished solely by short vowels, the overwhelming majority of written words represent more than one possibility and sometimes as many as a dozen or more. What precise word and vowel combination is intended is normally indicated by context, although occasionally you know what combination of vowels is correct only after reading further along in a text. Very occasionally, it is impossible to know, but this is quite rare in normal extended texts, but not at all rare when words are taken out of context. For example, I count a dozen ways to read كتب, all with something to do with books or writing, but all indicating differing words or grammatical forms.
We must also understand that Arabic is not only written phonemically, but also including some morphemic aspects. To write an utterance uniquely, you must know a minimum amount of morphology to distinguish some grammatical morphemes that are written uniquely or not written at all. For instance, /ṯalāṯa/ could represent either a pausal pronunciation of masculine ثلاثة or a non-pausal feminine accusative ثَلاثَ without nunation, again depending on context and reading style.
Another example of morphemic writing are the rules on how to write the definite article ال ("'al"). All three phonemes routinely change their pronunciation in context, since it is just a prefix, and yet it is always written the same.
A basic quirk of modern writing is that, although the Arabic Alphabet is traditionally described as having twenty eight unique letters, normal writing in most countries obligatorily includes at least one "diacritic" (hamza ء) and two mandatory variations of letters for morphological and historical reasons: the tāʾ marbūṭah ة and the ʾalif maqṣūrah ى.
The hamza ء represents the glottal stop, which is phonemic in Arabic in all positions. There are phonetically and graphically based rules as to whether and how to write the hamza, calling for five variations: on the line by itself; under an alif; or over an alif, wāw, or yāʾ; however, authorities are split about some of them, particularly when they would call for writing two or three wāws in a row, such as in yasūʾūna يَسُوؤُون (verb: sā'a سَاءَ "to act badly, be bad"). The result of this practice is that it is graphically ambiguous whether any alif or any non-initial wāw or yāʾ represents a hamza or their respect long-vowel equivalents /ā/, /ū/, or /ī/).
Wāw and *yāʾ in any position can also represent consonantal /w/ and /j/, respectively. This may not be a phonemic distinction in view of their complementary distribution with the equivalent long vowels, but it is significant for morphemic writing in Arabic and introduces more ambiguity since these final consonants can represent the final "consonant" of a root or one of the frequent final suffixes that include the long vowels ū or ī and even some infixes.
ِAlif does not always represent any underlying pronunciation. For instance, it is always written after wāw at the end of certain plural verb forms without any associated pronunciation (otiose alif) in order to distinguish it from other possibilities of interpretation. For example, you write it in تَدْعُوا ("you (masc. pl.) call (subj.)," but not in تَدْعُو ("you (masc. sg.) call (ind.)"). Alif is also usually kept even when the sound it might have represented diachronically is elided in context, such as what happens to اِسْم ('ism "name") in مَا ٱسْمُكَ؟ (mā smuka "What is your (masculine) name?).
Alif can also represent the accusative singular ending /ăn/ because this ending theoretically has the alternative pronunciation /ā/ in pause for obscure historical reasons.
Tāʾ marbūṭah ة represents either of the sounds of two other letters, depending on context. It is actually a graphical combination of hāʾ ه and the diacritics of tāʾ ت. It exists for particular historical reasons, but is useful because it represents a particular morpheme with the pronunciations of either hāʾ ه or tāʾ ت, according to context.
ʾAlif maqṣūrah ى is treated phonetically as a variating of alif ا; however, it is diachronically and graphically related to yāʾ ي. It may have originated as a variant pronunciation of /ā/, but that pronunciation is now defunct. Its use, however, tends to indicate something about the morphology of the words it occurs in that could not be indicated by the overworked alif alone.
Another oddity is the name Amr عمرو /ʿamr/ written with a final wāw that is not pronounced to distinguish it from the name Omar عُمَر (ʿumar).
In addition to all these alphabetic quirks, we must also address the fact that many modern Arab speakers do not actually pronounce all the traditional consonants as written. In the speech of many, certain consonants have merged and in the speech of others the distinction between pharyngealized and "regular" consonants is lost in some environments. For such speakers, they have to go by rote spelling or an underlying morphemic analysis to know what letter to write.
When you consider adding into the system the commonly used diacritics (the tashkīl), the system is phonetically complete, and almost any word can be read and written uniquely. The system is also fairly logical to someone with knowledge of Arabic grammar; however, it has lots of quirks that spoil a one-to-one correspondence between sound and diacritic. These quirks are caused both by the alphabetic quirks mentioned above and by attempts to address aspects of Arabic morphology. Examples are the three ways to indicate the "n" that is a morpheme used on most indefinite nouns, two ways to indicate the lack of an expected sound (sukūn سُكُونْ and waṣlah وَصْلَة), and three ways to write /ā/ (with an alif and fatḥah فَتْحَة, with maddah مَدَّة, and with the dagger alif (أَلِف خَنْجَرِيَّة)).
Arab children are not just taught to read, but taught to read in a version of their "mother tongue" that is always phonetically different from their daily speech. As a result of this diglossia, teaching the correct details of pronunciation is very important to begin with. As a child or foreign learner becomes familiar with standard Arabic grammar and morphology, a large degree of the normally unwritten phonology becomes more and more superfluous, and reading is done more through a morphemic lens. Most or all the extra diacritics become unnecessary clutter, except when some new words are encountered whose morphemic structure may be unclear from normal writing.
As for writing, I would think that only a very small minority of speakers are truly fluent in the standard language and so write through morphemic and grammatical analysis (conscious or unconscious), rather than relying solely on pronunciation. For example, I think that at least throughout North African, Egyptian, and Levantine Arabic, speakers' habitual distinctions of long and short vowels would not be a perfect match for the writing system, and so they would choose the correct written form according to their knowledge of the morphology of the standard language, not according to their default pronunciation.
Because of all these quirks, Arabic written with the normal diacritics can generally be read and written in a graphically unique fashion and so might be considered a shallow orthography. In reality, however, writing correctly requires knowledge of the morphology and many rules, even if reading does not. Without those diacritics, both reading and writing must be done through knowledge of the morphemes and grammar.