Automatically open a terminal window and run a command, robustly

Solution 1:

Save whatever script you wish to a file and when you change the extension to .command

Finder will robustly make a command line window that’s new to run that command / script. This works for whatever #!/bin/whatever shell or script you start the text file.

AppleScript can open documents just like when Finder clicks on them to open, this should be a fairly universal way to accomplish your task.