Steve,
Not sure if you still need this but I've had a go at writing a similar plugin (for scratch today and it does appear to be quite easy)
// usage: [scratch src="XX"][/scratch]
function rgo_scratch($text) {
$first_part = <<<EOD
<applet id="ProjectApplet" style="display:block" code="ScratchApplet" codebase="http://richards-mac.local/" archive="ScratchApplet.jar" height="387" width="482">
<param name="project" value=
EOD;
$second_part = <<<EOD
>
</applet>
EOD;
$text = str_replace( '[scratch src=', $first_part, $text);
$text = str_replace( '][/scratch]', $second_part, $text);
return $text;
}
add_filter('the_content', 'rgo_scratch', 99);
You just need to a few minor changes to make this work for you.
Edit: This plugin doesn't do checking to make sure that the scratch BB code is correctly formatted y the author or check if it is complete. Maybe it should. Oh, GPL of course.
Richard
PS. This plugin doesn't work! Not sure why the java applet loads but then fails trying to load the project. Oh well.