Good task for learning lisp. The steps.
Pick block 1 using entsel, get insertion point, get X1 & Y1
Pick block 2 using entsel, get insertion point get X2 & Y2
Hor dist X2 -X1
Ver dist Y2-Y1
Have a go, never to late to learn.
Agree with Steven start small, no good asking for I want a BOQ for my 30Mb dwg. Some code can end up like 1000 lines.
There is a tutorial included with a Acad called "down the garden path". I think its down in samples directory. There are electronic books out there, look on kindle, another is Afralisp has good tutorials.
So ask about a task we can provide the steps involved without providing code so you can have a go.
Be aware CHATGP & Copilot will write lisp code some times its ok but often it is not usable.
Lastly get a copy of Notepad++ a great editor for lisp code.