Algorithm to find sets of vertices connected to at most one incoming and one outgoing vertex outside the set
Let's name the vertices $v \in V \setminus U$ and $u \in U$ the vertices that are allowed to have out-neighbors anywhere.

Suppose that we know the vertex $u$ and delete all its out-edges.

Now we are looking for a vertex $v$ that "separates" the graph in two components, $V \ni v$ and $U \ni u$.

We can find $u$ in $O(n)$ time by trying all possibilities.  We can also find the strongly connected components in $O(n + m)$ time.  In this graph, we must find $v$ with the above property.  That can be done in linear time $O(n + m)$.  Hence it all runs in $O(n(n+m))$ time, which is at most $O(n^3)$.