Very interesting. I have a huge corn plant, that has only bloomed twice in the dozen years or so I have had it (and not two years in succession). But blooming should not harm the plant if it is otherwise healthy. I think they tend to bloom more when they are rootbound, so you could try repotting it. Loosen up the roots, give it fresh soil and a bigger pot.
But did you mean to say it smelled PRETTY?

When mine bloomed, I had to cut the flowers off, because I couldn't stand the smell... overpowering, sickly sweet, cloying, artificial smelling. It took me a while to figure out where the smell was coming from, because it didn't occur to me that pretty flower could be making that awful smell. (Also the flowers are only open in the evening, making it a little harder to track down, because the scent would come and go.)
I looked it up a little bit and found a wide range of reactions to the smell, with other people agreeing with me that they cut the flowers off to avoid the smell, and some people that really like it: "their fragrance is extremely strong, but very sweet and beautiful." https://davesgarden.com/guides/pf/go/54287/
I don't know if there are different varieties that have different smells or if it's just different strokes for different folks!