"Suppose $D$ is a string...".
No it is not.
Because if this were a string (a discrete sequence), then its content would take values from an alphabet of symbols, say $A \in \left[0 \dots (b-a) \right]$ where $b,a \in \mathbb{N}, b>a$ with some uniform discrete probability $\mathcal{U}(0,|A|)$, where $|\cdot|$ denotes the length of the sequence. Then, the operation of correlation would not make sense and we would have to use an appropriate string "similarity" function. For example, the hamming distance. Then, we would accept an error rate, which would represent the number of symbols set in "error" by some noise process. In ideal conditions, the normalised hamming distance (the sum of all symbols in error in a sequence divided by the length of the sequence) would be $0$ and as the error rate increased, so would the hamming distance all the way to $1$ in which case we would miss the entire sequence.
But that is not what is implied here. What is implied here is that $D \in \mathbb{R^k}$ (where $k$ here denotes the length of $D$), it takes values from a continuous $\mathcal{U}(a,b)$ and these represent the "message". This message is then contaminated by additive white gaussian noise to produce $X$. Then, we try to correlate a rolling window (of finite width) of $D$ over $X$ and observe the amplitude of the correlation at each "window shift" ($C_n$).
So, given that former framework where $D \in \mathbb{R}$:
The first step in modelling this is to look at what is the output exactly. The output is something like "What is the probability that the amplitude of correlation makes (or does not make) the threshold?". Without knowing anything else about the amplitude of each correlation ($C_n$), its value can swing anywhere $\in \left[-1 \dots 1 \right]$. So the probability there is some $p \in \mathcal{U}(-1,1)$. Not very useful yet.
Under ideal conditions (no noise), we would expect the correlation to correctly recognise the subsequence every time. So, if $P$ was repeating in $X$, $C_n=1$.
In the presence of additive white gaussian noise, the correlation amplitude is reduced (+). And, not only $C_n$ is reduced but any estimate of $n$ (where the sequence was detected, the $n$) is becoming uncertain too.
Additive white Gaussian noise is kind of special because its correlation with anything is $0$. So, if you had something like $Z_{\alpha} = \alpha \cdot X + (1-\alpha) \cdot \mathcal{N}(0,\sigma)$, then the correlation of $Z_1, Z_0$ is $0$. Another way to look at $\alpha$ is as (a variable proportional to) the signal to noise ratio (SNR). The lower the $\alpha$ the more noise you get in the signal, the more noise you get in the signal, the lower the correlation amplitude gets, the lower the correlation amplitude gets, the harder it is for it to reach the threshold.
What is the lowest value the correlation can attain?
It is zero. (If it gradually went towards $-1$, ....that would be spooky).
When will the correlation be zero?
When the noise will be at its maximum.
When is the noise at its maximum?
...it depends on the relative power between the noise and the signal. In other words, all things being equal, $\alpha$ depends on the length of $D$ to achieve the same SNR (but scaled up, to account for the fact that a sequence is now longer). For more details about this, you might want to have a look at this.
Long story short, this now brings us to the bit error rate curves. The theoretical bit error rate curves tell you how many symbols in error you are expected to get given the power SNR. These are also relevant here because at the end of the day, you are also making a binary decision. You either detect $P$ or you don't.
But, all that you have to do here is to adjust your $E_b/N_0$ for the lengths of the sequences you are looking for because in your case, your "bit" is the whole sequence $P$.
What is the theoretical expression for bit error rate?
$$BER = \frac{1}{2} \text{erfc}\left(\sqrt{\frac{E_b}{N_0}}\right)$$
Where $\text{erfc}$ is the error function. For more details on BER, see here
This $BER$ will tell you what you are after, that is, what is the probability that I miss a $P$ when it is there, given a particular SNR.
Hope this helps.
Notes:
+: The correlation has a finite range $\in \left[-1 \dots 1\right]$. Therefore, saying "...the standard deviation of the correlation signal..." is a misconception. This would be valid for something like $\mathcal{N}(0,0.2)$. But as the correlation tends to the edges of its range, this "...plus or minus..." of the standard deviation becomes invalid. When the conditions are such that the correlation hits $1$, there is no way its deviation will be anything else than $0$. So, perhaps this definition of the threshold as $K$ times the standard deviation of the correlation signal needs a bit more thinking depending on the problem at hand (?). I am assuming that it was defined in this way to then be able to determine a suitable value that guarantees detection.