I am trying to get the footage to loop but am having a very hard time doing this since I am new to after effects.
You wouldn't do that in AE. It would only result in more frames and thus counteract your requirement for the smallest possibel file size. Looping can be set as an option when playing back the SWF/ FLV.
Next, how would I get the after effects file to be an swf file with the lowest file size possible?
By not doing it in AE! Yes, you can export an SWF from AE, but that doesn't mean you shouldn't do it. SWF export is limited to emebdding each rendered frame as a JPEG, so files can still get rather large and not play back smoothly. A better way of doing this is to render an FLV via the render queue and then play that FLV vie a suitable pre-made player skin (floplayer, jplayer, nonverblaster etc.) on your page and set the variables of those players in such a way that they become effectively invisible (frameless) and loop the clip. Another option is of course to import your FLV into Flash and create a custom SWF there. Likewise, you could use Flash Catalyst.
Mylenium is right. I'll add one detail, though: He mentions rendering and exporting an FLV file from After Effects. An F4V file might be better; it works the same way within Flash, but it's a somewhat more modern format with better compression.