Actually, in the existing condition, osTicket has handled this.
Go to your Admin Panel -> Emails -> Templates -> osTicket Default Template, then see at the User -> Ticket Response/Reply section, at the Message Body you can define your own email template for displaying the ticket thread. Most of your variables you mentioned has been handled by osTicket in replaceTemplateVars() function in \include\class.ticket.php file.
If you need additional variables, then you can add them in the related function. For example, if you want to add the response text in the email template, see the using of it in the postResponse() function this following code:
$body = str_replace('%response',$response,$body);
Another example, if you want to add the signature, you can see this following code in the postResponse() function:
$body = str_replace("%signature",$signature,$body);
Does it make sense for you?
Sincerely,
Masino Sinaga