Representability of Hom of two abelian schemes Let $A$ and $B$ be abelian schemes over a base scheme $S$. There is the $\underline{\mathrm{Hom}}(A,B)$ functor $T \mapsto \mathrm{Hom}(A \times T, B \times T)$, where $\mathrm{Hom}$ means homomorphisms of group schemes.

Is it true that $\underline{\mathrm{Hom}}(A,B)$ is representable by a scheme of locally finite presentation over $S$?

(By an abelian scheme over $S$, I mean a smooth proper group scheme over $S$, with geometrically integral fibers.)
I am ok with assuming that $S$ is locally Noetherian if necessary.
--
If the abelian schemes $A$ and $B$ are moreover projective, one can make use of representability of the Hilbert scheme. I am not sure what to do if $A$ and $B$ are just proper, and not necessarily projective.
In the answer to this question
Representability of Hom of two finite flat group schemes
R. van Dobben de Bruyn mentions there is still an argument to show the representability of $\underline{\mathrm{Hom}}(A,B)$ by a scheme, but I have not yet found the argument.
 A: Thanks to Will Sawin for the suggestion. That works, here are the details:
Write $\underline{\mathrm{Mor}}(A,B)$ for the functor describing morphisms of schemes (as opposed to $\underline{\mathrm{Hom}}(A,B)$ for morphisms of group schemes).
By [Tag 0D1C] we know that $\underline{\mathrm{Mor}}(A,B)$ is representable by an algebraic space, locally of finite presentation over $S$, and admits an open immersion into the Hilbert functor $\mathrm{Hilb}_{A \times_S B/S}$ [Tag 0D1B] (which is also an algebraic space). This Hilbert functor is separated over $S$ [Tag 0DM7], so $\underline{\mathrm{Mor}}(A,B)$ is also separated over $S$. Taking a fiber product as in the prevously linked post [https://mathoverflow.net/questions/314723/representability-of-hom-of-two-finite-flat-group-schemes] shows that $\underline{\mathrm{Hom}}(A,B)$ is representable by an algebraic space, which is separated and locally of finite presentation over $S$.
By the criterion in [https://mathoverflow.net/questions/4573/when-is-an-algebraic-space-a-scheme] (more precisely, the reference to Théorème A.2 in Champs Algébriques by Laumon and Moret-Bailly which says that a separated locally quasi-finite morphism of algebraic spaces is represented by schemes), it is enough to show that $\underline{\mathrm{Hom}}(A,B)$ is locally quasi-finite over $S$. For this, we reduce to the case where $S = \mathrm{Spec}~ k$ for a field $k$. In this case, one knows that $\underline{\mathrm{Hom}}(A,B)$ is in fact étale over $\mathrm{Spec}~k$ (rigidity for morphisms of abelian schemes), hence locally quasi-finite.
