How to place components automatically according to a script in eagle cad?
Yes, it is possible to place a bunch of parts in some regular pattern by using a script.  That is exactly how I do this sort of thing when it comes up.

Use whatever your favorite programming language is to write the script.  This should be little more than a bunch of MOVE commands that you execute in the board editor.

I use programs to write Eagle scripts enough that I have a library of routines that write out common elements of Eagle scripts and other related useful operations.  For example, I have routines that open a script file, write coordinates in Eagle format after a 2D transformation, various layered ways to adjust the 2D transform like rotation and scaling, writing characters, strings, floating point numbers, write MOVE commands, convert between coordinate systems, etc.

Don't think you'll only do this once, so take a few minutes up front to write the subroutines.   That will make this even easier the next time you need to automatically generate a Eagle script.