Is there a nice condition on a closed subscheme $Y$ of $X$ such that for every flat family $Z\to Y$, there is a flat family $W\to X$ whose restriction to $Y$ is $Z$? In particular, I'm interested in the case when the closed subscheme is two lines in $\mathbb{P}^2$, or three planes in $\mathbb{P}^3$, or generally $n$ hyperplanes in $\mathbb{P}^n$.
I'm pretty sure the answer is not in general.
Take a Hilbert scheme which is reducible, for example, that of the Hilbert polynomial $3t + 1$ in $\mathbb{P}^3$. This Hilbert scheme has two irreducible components  the one corresponding to twisted cubics and the one corresponding to degree 3 plane curves union a point. The intersection of the these two components corresponds to degree 3 nodal plane curves with an embedded point "pointing out of the plane". It turns out that both components are rational (actually this is pretty easy to see) and even that the intersection is rational.
Anyhow, take a line in the twisted cubic component that meets the other component (see III.9.8.4 in Hartshorne's Algebraic Geometry) at a point $[C]$ and a line through $[C]$ contained in the other component. This gives you a flat family over the union of two intersecting lines in $\mathbb{P}^2$, but you will not be able to "fill it in" because the Hilbert scheme in question is not irreducible.
EDIT: I realized that, in this example, the family extended to $\mathbb{P}^2$ doesn't have to be as a family of closed subschemes in $\mathbb{P}^3$. Still, it cannot extend to a flat family in this example  just for a different reason. The general fiber of the extension would be a rational curve, but over a line in $\mathbb{P}^2$ you would have a disconnected family. This is impossible.
This is not going to help too much in your case, but we do have the following I think.
Suppose that we have a map $f : X \to Y$ which has a section (whose image we call $Y$ as well, as above), in other words $Y \subseteq X \to Y$ is an isomorphism.
Given a flat family $Z \to Y$, we can form $Z \times_Y X \to X$. I think this should do what you want. Of course, it won't help with $Y = $ two lines in $\mathbb{P}^2$.

$\begingroup$ Right, that's in particular how it works for one point in $\mathbb{P}^1$. But just to elaborate on why it doesn't work for two lines in $\mathbb{P}^2$: there can't be a surjective map from $\mathbb{P}^2$ to the two lines, because $\mathbb{P}^2$ is irreducible and so must be its image. $\endgroup$ Sep 30 '10 at 22:29

$\begingroup$ Indeed, although people do sometimes do contractions of this sort in the analytic setting (I recall seeing this in Hodge theoretic contexts) if you are willing to work analytically and sufficiently locally. $\endgroup$ Sep 30 '10 at 23:21