Capturing 404's is a breaze nowadays, ever since this proxy request mechanism was added to AOLserver. Here's what to do:
ns_section ns/server/${server}/redirects ns_param 404 "global/file-not-found.tcl" ns_param 500 "global/server-error.tcl"
I'm doing the same thing now to catch errors, with server-error.tcl. I'm not sure why the ns_section is called 'redirects'.