Fixed issue with short-duration timed dialog display (hat tip to Jose Pereda!), plus minor formatting changes/code cleanup.