se ho ben capito...
codice:
<script>
function audio_ok()
{	
	var embed = "";
	embed += "<EMBED ";
	embed += "src=\"alert.mid\" ";
	embed += "WIDTH=\"145\" ";
	embed += "HEIGHT=\"35\" ";
	embed += "AUTOSTART=true ";
	embed += "LOOP=\"true\">";

	document.getElementById("audio").innerHTML = embed ;
}

function cerca(parola)
{
	contenuto = document.getElementById("corpo").innerText;
	if (contenuto.indexOf(parola) != -1) {audio_ok();}
}
</script>
<body id="corpo" onLoad="cerca('ciao');">
	ciao
	<div id="audio"></div> 
</body>
(se nel documento è presente la parola CIAO)
il div con id "audio" mettilo nel punto in cui vuoi che compaia il plugin, (puoi anche renderlo invisibile)