How to make it simpler

Hi Guys,
First of all, Merry Christmas to everyone!

Is there an easy way to do the process I’m showing you in the script.
Simply put, take a single cue out of its group and place it anywhere in the cue list.

Below I show my solution.

tell application id "com.figure53.QLab.5" to tell front workspace
	set theCue to last item of (selected as list)
	set newCueID to uniqueID of theCue
	set thePara to (parent of theCue)
	set paraIDX to uniqueID of thePara
	set selected to thePara
	set theGrp to last item of (selected as list)
	set theGrpIDX to uniqueID of theGrp
	
	--move cue id newCueID of parent of theCue to beginning of the first cue list
	move cue id newCueID of parent of theCue to end of the first cue list
	--delay 0.1
	tell parent of (theCue)
		move cue id newCueID to before the (cue id (theGrpIDX))
		--move cue id newCueID to after the cue id theGrpIDX
	end tell
	set selected to theCue
end tell

Thanks
Best,
 Kalman