Howto write Scrips to validate responses

I would like to validate staff responses to tickets. Things like “can’t
close a ticket without including how long you spent on it”.

The contrib dir for 3.0 is very empty. Is there documentation somewhere
on Scrips and how they work? A few clean examples would probably suffice.

For this specific case I just need:

if ($minutes == 0) {
reject submission; # whatever that is, return -1 maybe?