I think Hook got it right when he told David to get some sleep. Although David can stay awake by not kissing Snow, and can use the extra time awake to obsess over the coin, it’s like that Star Trek TNG episode where everybody started hallucinating because they couldn’t enter the right stage of sleep to clear the fatigue poisons out of their brains.
As for why the ghost hallucination appeared like a flickering video effect with scan lines, men living on their own watch a lot of TV.