by frag.machine » Wed Sep 08, 2010 6:53 pm
I'd suggest to reuse the level_t structure from menu.c and compare the info there with cl.entities[0].model (of course, all of this during map loading, meaning you should place the conditional external texture loading after this test). The chance of an external map to have the same bspfile name and message of an original map is remote enough to turn the method effective.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC 
(LordHavoc)