Does mentoring an undergrad give an edge on job or grant applications?
Assuming the mentoring has a measurable successful outcome (student goes to grad school, student writes paper), the NSF would definitely look kindly on such mentoring. Whether the time spent doing this will (minute for minute) be a better value than writing an impactful paper - probably not. But that reasoning is of course flawed - you don't know ahead of time whether the time you spend writing that paper will pay off :). 

As with most other things, do it if you care about the mentoring process and enjoy working with undergraduates. Don't do it if the primary goal is to get the bullet on your CV.