Assnormalize is a project mainly written in Ruby, it's free.
this script normalizes ass subtitles for vlc player(it removes empty lines and sorts lines in time order)