Python-rtMIDI & AppleScript/JavaScript

I feel bad that I didn't take the time to write back immediately. Please forgive me.

I know. You taught me in another thread!

Nope. I need to use applescript to make different applications execute different actions.
Look at the script listed below. Only the last two blocks call Shell Scripts; the other blocks perform actions that directly talk to applications. Is this also possible with Custom Module? I mean, can a Custom Module contain instructions that, say, make different apps get the focus or perform different actions like the ones in the "SizeUp Actions" block (in my script)?

-- script cubase.SE-open in Preview

-- delay variables
set delayZero to 0.01
set delayOne to 0.3
set delayTwo to 0.6
set PageDelay to 2

-- set focus to the Score Editor in Cubase
tell application "System Events"
	tell application process "Cubase 10.5"
		perform action "AXRaise" of (first window whose name contains "Scores")
		delay delayZero
		tell application "Cubase 10.5" to activate
		delay delayZero
	end tell
end tell

-- print with command+shift+p (must be created through the Key Commands window)
tell application "System Events"
	keystroke "p" using {command down, shift down}
	delay delayOne
end tell

-- SizeUP actions
tell application "SizeUp" to do action Next Monitor
delay delayTwo
tell application "SizeUp" to do action Center
delay delayOne

-- PDF dropdown
set firstX to 721
set firstY to 597
do shell script "eval $(/usr/libexec/path_helper -s); cliclick c:" & firstX & "," & firstY
delay delayZero

-- Open in Preview
set secodX to 737
set secodY to 623
do shell script "eval $(/usr/libexec/path_helper -s); cliclick c:" & secodX & "," & secodY
delay delayZero