to make a script,
make a notepad txt file and type the exact input that you are typing into the command bar including enters (not spaces)
Start by turning of the object snaps so that your insertion point for the block will be respected.
OSMODE
0
-LAYER
S
YourLayerName
-INSERT
YourBlockName
YourXValue,YourYValue
1
1
YourRotationValue
OSMODE
143
then type what you want. The above is untested, you can modify as needed. Usually it's the amount of enters that is causing an issue. Save the notepad.txt with a .scr extension and you can drag it into your drawing.
To make a macro replace the enters with a semicolon ;
If you want a lisp version with more user control or a VBA or .NET version there is another forum full of people that can help you with that.
https://forums.autodesk.com/t5/autocad-customization/ct-p/AutoCADTopic1