christianc, te dejo este ejemplo burdo para que veas la idea. Supongo que sabrás mejorarlo.
Código:
<html>
<head>
<script language="javascript">
function addSmile(){
document.formulario.texto.value += "«smile»"
}
function showTxt(){
var sText = document.formulario.texto.value;
sText = sText.replace(/«smile»/ig, "<img src='smile.bmp'>");
vWin = window.open();
vWin.document.open();
vWin.document.write("<html><head></head><body>" + sText + "</body></html>");
vWin.document.close();
}
</script>
</head>
<body>
<form name="formulario">
<table width="200">
<tr>
<td colspan="2">
<textarea name="texto" rows="5" cols="20"></textarea>
</td>
</tr>
<tr>
<td>
<input type="button" name="bSmile" value="Smile" onclick="addSmile()">
</td>
<td>
<input type="button" name="bShow" value="Mostrar" onclick="showTxt()">
</td>
</tr>
</table>
</form>
</body>
</html>
Suerte.