How are your abilities with LISP or programming? If we give you hint of what to do would that be enough for you to make a start?
For the circle numbers, what is the logic behind their numbering in each rectangle?
Rectangles - I assume are closed polylines, but will the drawing have any other 4 sided closed polylines that are not to be assessed?
Perhaps upload a sample drawing if you can?
How often will you be doing this? (daily, weekly, monthly, once a year)
If it was me I'd go back a few steps and have the user to select the circles in the order they want them numbered and put in the text from there - much easier to program