not many could give an answer from all that code.., but you have described the problem well enough i think without all that
set the render globals
name.#.ext (this readies maya for animating image sequences.., another word might be.., moving pictures, movies.., nor still frames.
set the amount of frames.., default is 1-10
how many frames.., ecery second?? or ALL
next frame padding.., set it to 5 (helps the composite app )
the rest im sure you know
you could read more in the help files (I hate it when people say that)
or
go to the FREE tut here on SM on rendering.., by Mike if i recall.., nice vibe video
take it easy and life will be easy