You probably can do it with a script, but I would set it up with a simple expression that uses a number from the comp name to drive keyframe changes on the dropdown… Sounds more complicated than it is.
Try this:
Change you comp name to have a 1 at the end of it (like “My Comp 1”) and add a keyframe for the first menu selection (time doesn’t matter).
Then add a new keyframe for the second menu selection and continue doing the same for all menu selections. Again the time doesn’t matter, it could be one frame or one second…
Then add this expression to the dropdown’s ‘menu’ property:
n = thisComp.name ;
n[ n.length - 1 ]
at this point, if you comp has a ‘1’ at the end of the name, the first menu item should be selected no matter what keyframe you are on.
Now just duplicate the comp so you have 4 of them. Each comp should now have a menu selection set to the number at the end of the comp name.
Add them to the render queue and render.