I can't imagine this is something anyone is going to need to do very often, but it took me ages to figure it out so I thought I'd put it on the forum in case someone ever searches for it. The actual blender script is fairly simple.
With quake3 being the name of the script that launches the game. The problem I encountered was that quake3 would try to launch, but would fail due to errors. The relevant error turned out to be this...
SDL using driver "dummy"
It seems that when you try and run a program from within blender it messes up SDL_VIDEODRIVER. To remedy this I added a line to my quake3 script to fix it. Like so...
Now that my quake3 script actually sets SDL_VIDEODRIVER before running ioquake3 there are no problems whatsoever.
Launching Quake3 from a Blender script may seem like an odd thing to do, but it could actually be quite useful. What I'm thinking of doing is adding some extra code to the .map export script to run a bash script. This bash script will compile the .map to bsp, make a pk3 of it, put it in Quake3's baseq3 folder and then make quake3 run this map. This means I could have a map set up in Blender and when I run the export script it's automatically launched in quake3. This would be a massive time saver.