Turn on the header :lexical, e.g.,
#+begin_src elisp :lexical t :results pp
You can also use #+PROPERTY: header-args:elisp :lexical t to turn it on for the whole org file. Or change org-babel-default-header-args:emacs-lisp to turn it on globally.
(setq lexical-binding t) in the code does not work ...
There is nothing like that: Org babel evaluates the source block by storing all the commands in a temp file, runs the file using the appropriate language interpreter, collects the output, does minor munging to it and writes it out as the results block. What you are asking for (a header argument that modifies this work flow) is fundamentally incompatible with ...
Would changing the input to a table work? Something like this:
| 3492-134.2 |
| 3492-134.2+1428 |
#+begin_src python :var tbl=foo :results output
for row in tbl:
I think that's about the simplest you can do. You can add entries to the table, but the source block does not ...