Better and faster way using CoolTerm (you don't need to active the app!!!) :
First you open and connect a terminal to your rs232 adapter. Then, you save it using a common name (here, I used "CoolTerm.stc")
Then you use these line as applescript cue in QLab :
tell application "CoolTerm"
WriteLine {"CoolTerm.stc", "test"}
end tell
In your case, If you use 2 ports, you should then have 2 coolterm windows, one for each port and saved in 2 different files (let's say coolterm_video.stc and coolterm_relay.stc
Then, you'll have :
tell application "CoolTerm"
WriteLine {"coolterm_video.stc", '"i" + "1"'}
end tell
or, without the " :
tell application "CoolTerm"
WriteLine {"coolterm_video.stc", "i + 1"}
end tell
And
tell application "CoolTerm"
WriteLine {"coolterm_relay.stc", "@1 n1"}
end tell
Have fun ;)