Ok I got there in the end with the help of google. The script is below in case other SecureCRT users find it useful. It's my first attempt at Applescript so open to any suggestions or ways to simplify.
One caveat is if the session name has a space it's not working. In this case the session name must be enclosed with quotation marks and I can't figure out the correct AppleScript syntax e.g. /Applications/SecureCRT.app/Contents/MacOS/SecureCRT /T /S "My Session". But as a workaround I can rename my session files and folders to remove any spaces.
set findThis to "/Users/*******/******/VanDyke/Config/Sessions/" -- SecureCRT sessions path
set replaceItWith to ""
set newText to switchText of "{query}" from findThis to replaceItWith
trim_ext(newText, ".ini") -- remove .ini extension
do shell script "/Applications/SecureCRT.app/Contents/MacOS/SecureCRT /T /S " & result & " > /dev/null 2>&1 &" -- start SecureCRT
to switchText of theText from SearchString to ReplaceString -- remove sessions path
set OldDelims to AppleScript's AppleScript's text item delimiters
set AppleScript's AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's AppleScript's text item delimiters to OldDelims
return newText
end switchText
on trim_ext(strg, trim_characters)
set trim_list to every character of trim_characters
set right_counter to -1
repeat with J from 1 to length of strg
if (character right_counter of strg) is in trim_list then
set right_counter to right_counter - 1
else
exit repeat
end if
end repeat
try
set strg to text 1 through right_counter of strg
on error
set strg to ""
end try
return strg
end trim_ext