I took Nis' page and improved it a bit. Here it is, for posterity:
/www/oacsh.adp
@result@
<formtemplate id="add-edit" style="standard-lars"></formtemplate>
/www/oacsh.tcl
ad_page_contract {
@author Nis Jorgensen
} {
{script:optional {}}
} -properties {
result
}
set user_id [ad_maybe_redirect_for_registration]
if {![string equal $user_id 298]} {
ad_abort_script
}
set result ""
if {[info exists script]} {
set script [ad_quotehtml $script]
}
ad_form -name add_edit -form {
{
script:text(textarea)
{label {Input tcl_script}}
{html {cols 80 rows 10}}
}
} -on_submit {
if {[catch {set result [uplevel $script]}]} {
global errorInfo
set result "ERROR:$errorInfo
"
}
}
ad_return_template