Yes, it's possible in various ways.
One important consideration is that the javascript doesn't have to go into the add template. It can be in the javascript template and if it is too long for that template too it can reside in an external js file which you can call either in the add template or in the javascript template.
Judging by your example above, it seems that you can reduce the size of the template considerably by not repeating the 'document.write' clause even if you break down the html writing to separate lines for better readability of the code. Something like:
document.write('<table><tr>
<td>1. Demonstrates very superior intellectual ability</td>
<td>||sid1'+i+'||</td>
</tr></table>');
As for the entry fields, one way to go about it is to dump all the field tags inside the template, each one enclosed in an identified div tag which is set to display:none. This way you will have all the fields hidden in the template and available for further manipulation by javascript.
Then, your document.write loop could look something like:
document.write('<table><tr>
<td>1. Demonstrates very superior intellectual ability</td>
<td>'+document.getElementById('sa1'+i).innerHTML+'</td>
</tr></table>');
The document.getElementById('sa1'+i) retreives the eclosing div of the desired field and the innerHTML retreives its content which is the field itself.
And there could be other more or less efficient ways to do all that depending on what your actual template requires.
hth 