Even better for the AppleScript version would be
set lowNum to 1
set highNum to 10
return random number from lowNum to highNum
No need to make your own function when there's a built-in one.
And as a one-liner, avoiding the "Filter" and "Calculation" actions:
%Variable%Local_lines[RAND(1,LINES(%Variable%Local_lines%))]\n%
As demoed here.