There are very few circumstances under which I think it's a bad idea for undergraduates to write research papers. These primarily have to do with the quality of the journal: so long as it is a reputable, peer-reviewed journal, I wouldn't be too concerned with the "strength" of the work.
The reason is that publishing while an undergraduate—particularly as a primary author—demonstrates that you have already started to learn the basics of how to do research in your field. This means that you're less of an "unknown" quantity, and therefore less of a risk for a department reviewing your application. If you don't publish the research, then there's no tangible proof, and then you need to rely on your research supervisor to make that point in a letter of recommendation. (But then the question becomes: "if she could have written a paper, why didn't she?")
As for the exceptions above, so long as you don't publish in "vanity" journals (those which will publish basically anything, so long as people pay the appropriate publication "fees"), you should be fine.