Well, you can render a h.264 file directly out of After Effects, but it doesn't nearly offer as many settings as x264 does, so the latter one will most likely give better results.
Feeding an After Effects project into an Avisynth script isn't possible though. The command line renderer simply uses After Effects' render engine without starting the main program.