Make :after more usefull

Added an if to not just append the line if :match and :after are defined but match delivers no matches. 
If the line exists it will work as before but if not it will not be appended but added at the :after position.