Yes it is possible...
Using the Chat prototype you can call I believe $CHAT._ProcessChatInput("Command")
for Console commands I'm not sure how you would go about doing that.
here is my Group GUI Script for handling Accepting and Rejecting Group Invites:
shared function onButtonClick( button as NodeRef of Class _GUIButton, args references Class GUIMouseEvent )
println("OnButtonClick: " + button.name)
args.handled = true
when button.name
is "Accept"
$Chat._ProcessChatInput("/accept")
close()
.
is "Reject"
$Chat._ProcessChatInput("/reject")
close()
.
default
.
.
.