If you are not shy about using JavaScript to accomplish this, and it sounds like you are not shy...
<textarea name="textareaX" rows=30 cols=3></textarea>
<input type="text" name="codefieldX">
<input type="button" value="Add HTML" onclick="this.form.textareaX.value=this.form.textareaX.value+=this.form.codefieldX.value">
For example.
This will produce a textarea, a text input field, and a button. When the button is clicked, anything in the text field will be appended to the end of whatever is in the textarea...all without triggering your form's action, which will be handled later when the user clicks the "submit" button.
You could also have several of these buttons dedicated to a particular HTML snippet, rather than having a variable text field.