Actually require the required fields

This modification will keep the user from closing the ticket when a required internal field has been left blank, and explain the problem to the user, and provide a link to edit the ticket to resolve the problem. Without this modification, if a custom internal required field is created, no one ever has to fill out the field unless staff edit the ticket. This modification helps ensure continuity among closed tickets so that they can be reliably polled for data via future plugins.
Kind of. I moved it outside the elseif($ticket->close()) statement because otherwise it only returned to main listing when the ticket closed successfully, not when it failed.