Simply speaking, as mentioned by Antoine, the accrual arises because default may happen between two payment dates and the accrued payment should be paid. $\Delta_i$ is the year fraction. Since $S_n$ is quoted as an annual rate, $S_n\Delta_i$ is the payment amount per $1 notional.
However, in the formula you mentioned, default is modeled at the same frequency as coupon payments. More generally, we can model default at a different frequency in a more granular way.
As a simplified example, let $t=1,\ldots,T$ be possible default dates, such as months and $d$ be the period between two payment dates ($d=3$ for quarterly payments, in this case $\Delta\approx0.25$ depending on day count convention). Let $\tau$ be the random default time with $1\leq\tau\leq T$ and $\tau\in\mathbb{Z}$. We assume that $T$ is a multiple of $\Delta$. Then the formula becomes
$$
\frac{S_n}{d}\sum_{j=1}^{T/d}\mathbb{E}_0^Q\left[\tilde{DF}_{jd}I(\tau>jd)\right]+\frac{S_n}{d}\sum_{i=1}^T\mathbb{E}_0^Q\left[\tilde{DF}_i\left(\frac{i}{d}-\left\lfloor\frac{i}{d}\right\rfloor\right)I(\tau=i)\right] = (1-R)\sum_{i=1}^{T}\mathbb{E}_0^Q\left[\tilde{DF}_iI(\tau=i)\right]
$$
where $\mathbb{E}_0^Q$ denotes conditional expectation at time 0 under the risk-neutral measure, $I(A)$ is an indicator function of event $A$, and $\lfloor x\rfloor$ is the largest integer that is less than or equal to $x$.
Here, $jd$ runs over all payment dates while $i$ runs over all possible default dates. The accrual on default arises due to mismatch between values of $jd$ and those of $i$. For example, if default happens at $i=4$, then one month has passed after the last payment date, the accrual is the payment corresponding to this 1 month period.
Finally, we assume independence between default and discount factor under the risk-neutral measure and define
$$
DF_{t}=\mathbb{E}_0^Q[\tilde{DF_t}],\quad SP_{t}=P^Q(\tau>t)=\mathbb{E}_0^Q[I(\tau>t)]
$$
then $\mathbb{E}_0^Q[I(\tau=t)]=SP_{t-1}-SP_{t}$. We can rewrite the above equation as
$$
\frac{S_n}{d}\sum_{j=1}^{T/d}DF_{jd}SP_{jd}+\frac{S_n}{d}\sum_{i=1}^TDF_i\left(\frac{i}{d}-\left\lfloor\frac{i}{d}\right\rfloor\right)(SP_{i-1}-SP_i) = (1-R)\sum_{i=1}^{T}DF_i(SP_{i-1}-SP_i)
$$
Now to conform to the equation you mentioned, we have to rewrite the summations of $i$ using $j$ with step $d$. Let $\tau^d$ be the random default time at payment dates, defined as $\tau^d=jd$ if $(j-1)d<\tau\leq jd$. For example, $\tau^d=3$ means default happens between time $0$ (excluded) and time $3$ (included). Then, we have
$$
P^Q(\tau^d=jd)=\sum_{k=(j-1)d+1}^{jd}(SP_{k-1}-SP_{k})=SP_{(j-1)d}-SP_{jd}
$$
To add discount factor, we need to make the following assumption:
$$
DF_{(j-1)d+1}\approx\cdots\approx DF_{jd-1}\approx DF_{jd}
$$
Then, the RHS becomes
$$
(1-R)\sum_{j=1}^{T/d}DF_{jd}(SP_{(j-1)d}-SP_{jd})
$$
To rewrite the second term on the LHS, we assume
$$
\sum_{i=1}^TDF_i\left(\frac{i}{d}-\left\lfloor\frac{i}{d}\right\rfloor\right)(SP_{i-1}-SP_i)\approx\sum_{j=1}^{T/d}DF_{jd}\frac{1}{2}(SP_{(j-1)d}-SP_{jd})
$$
which combines the assumption on the discount factor and an additional assumption that $x-\lfloor x\rfloor$ is on average around $\frac{1}{2}$.
Finally set $\Delta=1/d$, we arrive at the equation you mentioned, after re-defining the frequency.