> I would like to be able to define variables on first assignment and scoped to the begin/end in which that happens
Good news! Object Pascal has inline variable declaration with type inference:
https://docwiki.embarcadero.com/RADStudio/Florence/en/Delphi...
https://blogs.embarcadero.com/introducing-inline-variables-i...