I have a routine that does most of what you want as it is but with TEXT objects only. The selection method filters for only TEXT objects. Each text object must contain only one number. It can have many words but only one number in the format of either an integer or a real. You can get the routine for free here: sumtextnos.lsp It uses but does not require DOSLIB. The other things that are listed as "Required:" on the linked page for sumtextnos.lsp are NOT required (I'll have to fix that some day).
It does not ask for a size or place the total as text but that should be pretty easy for you to add to it. If you load DOSLIB prior to using it then it will copy the total to your clipboard automatically so that it can be pasted wherever you want.
The existing code examines the text string for a number, isolates it, converts it from a string into a real and adds it to the sum. The routine displays the numbers and the total to the text screen. It could do this for any text string so the routine could be expanded to read MTEXT, ATTIRBUTES, MULTILEADERS, and DIMENSIONS. There are formatting codes in some of these. Additional coding to deal with the specific needs for each of these would be necessary. Also, having more than one numeric value in the string will require code to determine which one or how many to use. It could get very complicated.
AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
8.6.52.0 AutoCAD Architecture 2024