check-msg.py: refactor main

Move last_lines close to verify_metadata. Combine tag code together.