Why would you use noindex on any page which eventually is able to be indxed in your archives?
I don't think it's a matter of duplicate URL's you probably have that sorted out. But like all the similar questions on stackoverflow sites they are all indexed and quite quickly. Exact duplicates get moderated by the community and are simply closed but left on the site to be crawled by search engines.
When Google and others visit your home page then crawl your question pages which are no NOINDEX those stay cached in their index for an indeterminate amount of time. It can be minutes, hours, days, weeks, or months before they re-index the same page which is now in your archives and has meta INDEX. That slight variation may not be enough for them to say ok lets re-index and re-cache this page.
I think you're feeding the search engines NOINDEX pages and that 5 minutes isn't fast enough to get them to the archive as indexed.
I would remove your script and let everything be indexed. If that's not possible I would go over your site architecture determine why you really need to have a page NOINDEX then INDEX and figure out a solution to get rid of that process all together.