*(Edited after Tomek Kania's comment – thanks!).*

The result is true also for Banach space-valued functions.

**Proposition:** Let $E$ be a Banach space and denote by $D([0,1], E)$ the space of $E$-valued càdlàg functions on $[0,1]$. Let $B$ be a Borel set in $E$ such that $0\notin \overline{B}$. Consider the mapping
$$(Tf)(t) = \sum_{s\leqslant t, f(s)-f(s-)\in B}\big(f(s)-f(s-)\big)\quad \big(f\in D([0,1],E)\big).$$
Then $T\colon D([0,1], E) \to D([0,1], E) $ is a Borel map with respect to the cylindrical $\sigma$-algebra in $ D([0,1], E)$.

For an open set $B$ such that $0 \notin \overline{B}$, write $\chi_B(x,y)=y-x$ if $y-x \in B$ and $\chi_B(x,y)=0$ otherwise. Define
$$\tilde{T}_B f(t) = \lim_{n \to \infty} \sum_{k=1}^{\lfloor n t\rfloor + 1} \chi_B(f(\tfrac{k-1}{n}), f(\tfrac{k}{n})) .$$
Next, write $B$ as the union of an increasing sequence $B_m$ of open and bounded sets, given by $$B_m = \{x \in E : \operatorname{dist}(x, B^c) > \tfrac{1}{m}\},$$ and define
$$T_B f(t) = \lim_{m \to \infty} \tilde{T}_{B_m} f(t) .$$
(Both limits above are understood in a pointwise sense).

**Claim:** $T_B$ is equal to the mapping $T$ defined in the proposition.

*Proof.* Fix $f \in D[0,1]$ and observe that $\Delta f(s) := f(s) - f(s^-) \in B$ for finitely many $s \in [0, 1]$. Denote these arguments $s$ by $s_j$, $j = 1, 2, \ldots, J$. Since $B$ is open, for all $m$ large enough we have $\Delta f(s_j) \in B_m$ for $j = 1, 2, \ldots, J$. We fix any number $m$ with this property, and we let $$\varepsilon = \min\{\operatorname{dist}(B_m, B_{m+1}^c),\operatorname{dist}(B_{m+1}, B^c)\}.$$
Next, we write $f = g + h$, with $g, h$ càdlàg, $g$ piecewise constant, $\Delta g(s) = \Delta f(s)$ if $\|\Delta f(s)\| \ge \varepsilon$ and $\Delta g(s) = 0$ otherwise (so that $g$ accumulates all jumps of $f$ of magnitude $\varepsilon$ or larger). There is a $\delta > 0$ such that if $t_1, t_2 \in [0, 1]$ and $\|t_1 - t_2\| < \delta$, then $\|h(t_1) - h(t_2)\| < \varepsilon$ (the proof of this property is the same as for continuous functions: otherwise $h$ would have a jump of magnitude at least $\varepsilon$).

For $n > 1/\delta$ large enough we have the following properties:

Each interval $I_k = (\tfrac{k-1}{n}, \tfrac{k}{n}]$, $k = 1, 2, \ldots, n$, contains at most one jump of $f$ of magnitude $\varepsilon$ or larger; in particular, it contains at most one of the numbers $s_j$, $j = 1, 2, \ldots, J$.

If $s_j \in I_k$ for some $j = 1, 2, \ldots, J$, then $$g(\tfrac{k}{n}) - g(\tfrac{k-1}{n}) \in B_m$$ and $$\|h(\tfrac{k}{n}) - h(\tfrac{k-1}{n})\| < \varepsilon.$$ Therefore, $$g(\tfrac{k}{n}) - g(\tfrac{k-1}{n}) \in B_{m+1}.$$

If $I_k$ contains no $s_j$, $j = 1, 2, \ldots, J$, then $$g(\tfrac{k}{n}) - g(\tfrac{k-1}{n}) \in B^c$$ and $$\|h(\tfrac{k}{n}) - h(\tfrac{k-1}{n})\| < \varepsilon.$$ Therefore, $$g(\tfrac{k}{n}) - g(\tfrac{k-1}{n}) \notin B_{m+1}.$$

It follows that for $n$ large enough,
$$ \sum_{k=1}^{\lfloor n t \rfloor + 1} \chi_{B_{m+1}}(f(\tfrac{k-1}{n} t), f(\tfrac{k}{n} t)) = \sum_{j=1}^J (f(\tfrac{1}{n} \lceil n s_j \rceil) - f(\tfrac{1}{n} \lceil n s_j - 1\rceil)) \mathbb{1}_{\{n s_j \le \lfloor n t \rfloor + 1\}} . $$
As $n \to \infty$, the right-hand side converges to
$$ \sum_{j=1}^J (f(s_j) - f(s_j^-)) \mathbb{1}_{\{s_j \le t\}} , $$
which is the desired quantity $T f(t)$.

We have thus shown that for $m$ large enough, we have
$$ \tilde{T}_{B_{m+1}} f(t) = T f(t) . $$
In particular, $T_B f(t) = T f(t)$. Our claim is proved.

By inspection we find that the map which assigns
$$ t \mapsto \sum_{k=1}^{\lfloor n t \rfloor + 1} \chi_B(f(\tfrac{k-1}{n}), f(\tfrac{k}{n})) $$
to a function $f \in D[0,1]$ is measurable (with values again in $D[0,1]$). Pointwise limits preserve measurability, and $T_B$ again takes values in $D[0,1]$, so $T_B$ is also measurable from $D[0,1]$ to itself. (Note that $\tilde{T}_B$ does not take values in $D[0,1]$ and it is not even well-defined on all of $D[0,1]$, but this is not an issue: we defined $T_B$ as an iterated limit, and the inner limit (with respect to $n$) exists for all $m$ large enough).

The rest is standard: consider the class $\mathcal{B}$ of sets $B$ for which the corresponding map $T$ is measurable. Then $\mathcal{B}$ is a $\lambda$-system that contains the $\pi$-system of open sets. Here we fix $\varepsilon > 0$ and we consider sets in $\mathcal{B}$ as subsets of $\{x \in E : \|x\| \ge \varepsilon\}$ to avoid addition of infinitely many jumps. By Dynkin's lemma, $\mathcal{B}$ contains all Borel subsets of $\{x \in E: \|x\| \ge \varepsilon\}$. This proves measurability of $T$ for any Borel set $B$ such that $0 \notin \overline{B}$.

(By the way, not every formula defines a measurable object; for example, $D[0,1]$ itself (and $C[0,1]$, and balls in the supremum metric) are not measurable subsets of the class of all real-valued functions on $[0,1]$ with the $\sigma$-algebra generated by cylinder sets).