Problem with JS converting module form d6 to d7
Make sure that the $(selector, context) is valid on the page it's being called. You should be able to do this by doing a console.log($(selector, context)); in the first line of the function.

Assuming the selector and context are valid, the .each() should be executed.

If they are not valid, you may have to replace the element or context being passed into Drupal.smackdown.attachNotice().