So I got it working with the following script. Take it with a grain of salt, this was just me testing some stuff- but it works on a mac at least.
//////----------------------------------------
string $array[] = {"red","orange","blue"};
string $scriptBody = "I'm a bunch of text";
string $getTxtPath[] = fileDialog2 -fileMode 4 -dialogStyle 1
; //Find Current File
string $TxtPath = $getTxtPath[0]; //Make path string NOT string[]
string $dirname = dirname($TxtPath); //Get Directory name
string $dirname = $dirname + "/"; //Append a slash to Directoryname
string $NameWithExtension = match "[^/\\]*$" $TxtPath
; //Remove Path from File Name
string $Name = match "^[^\.]*" $NameWithExtension
; //Remove extension from file name
string $makeSubTextDir = sysFile -makeDir ($dirname + $Name)
; //Create directory with the name of file name in same directory as current shell
for($i=0;$i<size($array);$i++){ //Create a shell script in the new directory for each item in array
$createBlankShell = ($dirname + $Name + "/" + $Name + "_" + $array[$i] + ".sh");
$fileId = fopen $createBlankShell "w"
;
fprint $fileId $scriptBody;
fclose $fileId;
system ("chmod 755 \"" + $createBlankShell + "\"");
}