I'm not a big fan of changing individual objects linetype scales, but I do not know your application for it. Typically this should be done with LTSCALE. at the entity level it can become a real headache for anyone referencing your drawing files to get their linetypes to look correctly.
Now that that is out of the way. You have two options.
1. Highlighting the object in question and just using the Properties dialog is pretty efficient at completing the task you are wanting. This would apply same ltscale to all selected. so you would want to select all the ones with the same ltscale.
2. If you want to learn how to update this lisp file to handle multiple entities, then start with the following.
Since you want to apply a scale factor to each individual entities current LTScale, you will need to step through each one.
Start with getting a selection set
(setq myss (ssget))
then check if it is empty
(if (myss
next you will need to step through all the entities and change their ltscale, but first you need to prompt for the scale to apply to each.
(progn
(setq myscalefactor (getreal "\nScale Factor to apply: ") ; get your scale factor
mynuments (sslength myss) ; how many entities to modify
mycnt 0 ; entity counter
)
now start a while loop or some other loop method to step through the selection set
(while (< mycnt mynuments)
(setq myentdata (entget (ssname myss mycnt))
myentltscale (assoc 48 myentdata)
)
Trick here is to see if it exists ltscale at 1.0 means it is defaulted and does not exist so we will have to add if not
(if myentltscale
(setq newltscale (* (cdr myentltscale) myscalefactor) ; apply scale to current ltscale
newltscale (cons 48 newltscale) ; create the dxf entry for the new scale factor
myentdata (subst newltscale myentltscale myentdata) ; substitute the new value for the old value
)
(setq myentdata (append myentdata (list (cons 48 myscalefactor)))) ; just create a dxf value for the ltscale
)
(entmod myentdata) ; update the entity
(setq mycnt (1+ mycnt)) ; bump our counter
)
wrap that all in a defun statement and you should be good to go.
Good luck