SWPM is already a mostly automated tool. All you have to do is provide some parameters at the beginning and then let it rip. So, it is doing most of what your script would do.
There are other manual activities to do after SWPM has finished, of course, as detailed in the system copy guide. Mostly these aren't part of SWPM because they are too specific to your environment, but obviously within your environment they will be mostly the same each time. Also, most of these tasks are done within the system, via SAPGUI, so for automation you might be looking at a combination of a GUI script plus an ABAP program, something like that. That is something you'll probably have to develop in-house, though, precisely because it is so customer-specific.