How to add components using loop in Eagle PCB script?
It is possible to use a ULP to execute editor commands, but only in a very non-obvious way:
The built-in exit() function can be given a string that is executed immediately after the ULP has exited:

exit("ADD whatever...");


See the file cmd-draw.ulp for a complete example.