Refactor external display checking into function

Additionally, don't sleep before 1 second before checking for the
external display.