You should be able to use the "import snapshot" command for this purpose. The following script allows you to take a snapshot of the whole screen-
import snapshot from rect (the screenrect)
or if you wish to have the same functionality as cmd + shift-4 then it would simply be:
import snapshot
This will bring up a small arrow that you drag to capture a specific area of the screen.
Importing snapshot creates a new image object on your stack that will be, by default named a variation of "image id 100*"
A list of ways to capture a snapshot using the "import snapshot" command can be found below. These are taken form the "import snapshot"
dictionary entry-
To import a snapshot for a portion of a stack you use the form: import
snapshot from rect[angle] of window windowID Where windowID is the
windowID property of the required stack.
To import a snapshot of a specific (non-stack) object, use the form:
import snapshot from rect[angle] of chunk Where chunk is any chunk
expression resolving to a control, or any expression evaluating to a
control reference.
To import a snapshot of an object that has graphic effects applied to
it, use the with effects form: import snapshot from rect[angle] of
chunk with effects Where chunk is any chunk expression resolving to a
control, or any expression evaluating to a control reference.
To import a snapshot of an object in iOS use the form: import snapshot
from [ rectangle rect of ] object
To import a snapshot of the screen in iOS use the form: import
snapshot from rectangle rect