It could be that you prematurely optimized the task and then got lucky that the optimization turned out to be necessary later on. Your story reads as if you are saying that you were correct to automate the task because later you happened to need the automation, despite not having any reason to believe that automation would be needed. ie. Buying a lottery ticket was perfectly reasonable because I happened to win.
That being said, based on the numbers given, the optimization would make sense as long as you knew the task would be needed to be done at least 16 more times, which I imagine was the case. That also assumes there wasn't anything more pressing that needed to be worked on.