$\def\sO{\mathcal{O}}
\def\sI{\mathcal{I}}$As you say, any (locally) closed subset $Z$ of a scheme $X$ can be given a unique locally closed reduced subscheme structure (apply Tag 01J3 to some open $U\subset X$ containing $Z$ as a closed subset). The thing is that Hartshorne makes the claim for arbitrary $X$, so this construction cannot give the correct scheme structure on $\Delta(X)$. The other alternative I can think of is endowing $\Delta(X)$ with the structure sheaf $\mathcal{O}_{X\times_YX}|_{\Delta(X)}$, so that $\Delta:X\to X\times_Y X$, as a morphism of locally ringed spaces, factors through $\Delta(X)$:
Lemma. If $f:X\to Y$ is a morphism of arbitrary locally ringed spaces and $A\subset Y$ is a locally closed subset containing $f(X)$, endowing $A$ with the structure sheaf $\mathcal{O}_Y|_A$ we have that $f$ factors uniquely through $A$.
(See proof below.)
This approach has two problems: (i) the locally ringed space $\Delta(X)$ may not even be a scheme and (ii) the factorization $X\to\Delta(X)$ won't be an isomorphism in general (it is a homeomorphism on spaces but the map induced on stalks of structure sheaves equals $\sO_{X\times_YX,\Delta(x)}\to\sO_{X,x}$, which isn't an isomorphism in general).
For me, the conclusion is that when Hartshorne says that “$\Delta$ gives an isomorphism of $X$ onto its image $\Delta(X)$” we must interpret this fact to hold by definition, i.e., we set the structure sheaf on $\Delta(X)$ to be $(\Delta_*\sO_X)|_{\Delta(X)}$. Denoting $\delta:X\to\Delta(X)$ to the map on spaces given by restriction of $\Delta$ to its image, the morphism of locally ringed spaces $X\to\Delta(X)$ is $\delta$ on spaces and on sheaves it's $\Delta^{-1}\Delta_*\sO_X=\delta^{-1}[(\Delta_*\sO_X)|_{\Delta(X)}]\to\sO_{X}$, i.e., the counit of $\Delta_*\dashv\Delta^{-1}$. This counit is an isomorphism [ref]; thus $\delta:X\to\Delta(X)$ is an isomorphism of locally ringed spaces. The morphism $\Delta(X)\to X\times_YX$ is defined to be the morphism $\Delta\circ\delta^{-1}$.
Alternatively, one can consider the ideal sheaf $\mathcal{I}=\ker(\sO_{X\times_YX}\to\Delta_*\sO_X)$. If $U\subset X\times_Y X$ is an open subset containing $\Delta(X)$ as a closed subset, then $\mathcal{I}|_U$ is $\sO_U$-quasi-coherent. Thus, we can consider the closed subscheme of $U$ cut off by $\mathcal{I}|_U$. Namely, it's the topological space $\Delta(X)=\operatorname{Supp}(\sO_U/\mathcal{I}|_U)$ along with the structure sheaf $(\sO_U/\mathcal{I}|_U)|_{\Delta(X)}$. (This construction works for any locally closed immersion of arbitrary locally ringed spaces $f:X\to Y$; we have that $f$ factors uniquely through the locally closed subspace $(f(X),(\sO_U/\sI|_U)|_{f(X)})$, where $\sI=\ker(\sO_Y\to f_*\sO_X)$ and $U\subset Y$ is some open containing $f(X)$ as a closed subset.)
For completeness:
Proof of the lemma. We use Tag 01HP. We may ignore the hypothesis that $\sI$ is locally generated by sections (it isn't used anywhere on the linked proof). Also, even though the linked result is stated for closed immersions, the conclusion is the same for locally closed immersions (one can reduce the proof to the case of closed immersions by restricting the codomain to an open subset where the image is closed). It suffices to verify assertion 4 in #8525. By definition, $\sI=\ker(\sO_Y\to i_*\sO_A)$ and we have $\sI_y=\ker(\sO_{Y,y}\to\sO_{A,y})$. Hence,
\begin{equation}
\sI_y=
\begin{cases}
0,&y\in A,\\
\sO_{Y,y}&\text{otherwise}.
\end{cases}
\end{equation}
Thus $f^{-1}\sI$ is zero (it is zero on all its stalks) and assertion 4 holds. $\square$