The Gothic element there is the horror that ensues after he hears the tapping. The character is alone during a spooky, dreary night, nobody found anywhere, and suddenly there is a mysterious tapping by someone, and it turns out that no-one tapped, which means either madness or ghosts, that are either way both elements of Gothic writing.
Although opportunity cost is definitely important, it is hard to put a "price" on the opportunity in many cases, which makes it unmeasurable. This is why economists focus almost exclusively on price.