Our general rule of thumb:
When you see repeated code, you should sense the opportunity to extract that code and place it in a subroutine.