I had the 30L carboy filled to the 24L mark. After about 12 hours I had a slow but steady fermentation starting. I came home 2 hours later and the airlock was full of muck. Then before my very eyes, the airlock exploded and I had a mess all over the ceiling ...

Note that I have a plastic barrel carboy, not narrow bottle-neck glass variety.

I cleaned up the lid and airlock, loosely fitted the lid and more mess started to appear. I left it like that and let it spew it's froth for most of the afternoon. I've now removed the lid and loosely fitted a large sheet of aluminium foil over the top.

See if you can get a bung and some tubing and make something like this http://www.homebrewtalk.com/f39/blow-off-223407/
If the fermentation was that strong, you should be ok (hope you sanitized the foil). At this point, either you will get an infection or you wont so just keep fermenting and then before bottling or kegging, taste the beer and if it tastes ok then disaster avoided.

Yeah definitely use a blowoff tube. Just stick a length of tubing into the hole the airlock fits in and submerge the other end in a pitcher with sanitizer in it. I've also seen people stick the tubing into the center of the airlock the 3piece type not the s lock type.