I'm not sure if you are interested in Learning Lisp or just want a routine. It sounds like you just want a routine but you are asking very specifically for data to insert them again.
So for the learning part.
First you can get a selection set of your block inserts.
(setq myss (ssget "X" '((0 . "INSERT"))))
next step is to figure out how many blocks you have
(setq mysslen (sslength myss))
Next we loop through all of the block inserts. I personally like using a while loop for this
(setq mycnt 0) ; Sets my start index
(while (< mycnt mylen)
(setq myent (ssname myss mycnt)
mydata (entget myent)
myins (cdr (assoc 10 mydata)) ; This is the insert point of the block it contains the WCS 3D point
myXscale (cdr (assoc 41 mydata)) ; This is the XScale factor
myYscale (cdr (assoc 42 mydata)) ; This is the YScale Factor
myZScale (cdr (assoc 43 mydata)) ; This is the ZScale Factor
myRot (cdr (assoc 50 mydata)); This is the rotation
myblkname (cdr (assoc 2 mydata)) ; This is the block name
mycnt (1+ mycnt) ; bump the index counter
)
;From that information you have a crude set to do your block inserts
(entdel myent) ; Delete the old entity
(setq attreqval (getvar "ATTREQ")); Store the state of attreq
(setvar "ATTREQ" 0) ; Turn off attribute prompts
(command "insert" myblkname "X" myxscale "Y" myyscale "Z" myzscale myins myrot)
(setvar "ATTREQ" attreqval) ; Set the ATTREQ variable back to the original value
); Close the while loop
A few things to note. This is a crude start to a function or command. You will need to wrap a defun around this and define your function name.
There are many other aspects needed to complete this
Will this handle blocks with attributes?
What about maintaining existing attribute values, settings
Will this handle blocks inserted on other Coordinate systems
Error trapping
What about redefining the actual block definition from an external file location
Original Layer insertion
Dynamic blocks and their settings?
As you can see there are many factors to take in consideration, I'm sure I have even left some out.
Good luck