The bound given at the end of the question seems to be incorrect.
Suppose that $f:X\to 2^X$ is such that $|X|=n$, $|f(x)|=k$ for each $x\in X$, and either $x\in f(y)$ or $y\in f(x)$ whenever $x,y\in X$ and $x\ne y$. For each $x\in X$ let $A_x=\{y\in X:x\in f(y)\}$. Then
$$\sum_{x\in X}|A_x|=\sum_{x\in X}|f(x)|=kn\;,$$
so there must be at least one $x\in X$ such that $|A_x|\le k$. If $y\in X\setminus A_x$, then $x\notin f(y)$, so $y\in f(x)$ provided that $y\ne x$. Thus, $f(x)\supseteq X\setminus(A_x\cup\{x\})$, and therefore
$$k\ge n-|A_x\cup\{x\}|\ge n-(k+1)=n-1-k\;,$$
i.e., $n\le 2k+1$. In other words, in order for a ‘bad’ function even to be possible, we must have $n\le 2k+1$. Taking $n\ge 2(k+1)$ therefore ensures that every function $f:X\to 2^X$ is good: there are $x,y\in X$ such that $x\notin f(y)$ and $y\notin f(x)$.