Have a boolean flag that indicates if Coroutine Y is running at the instant:
bool isYRunning = false;
IEnumerator Y
{
isYRunning = true;
//stuff...
isYRunning = false;
}
And in X, have something like this:
int waitAmount = 10, waited = 0;
IEnumerator X
{
//stuff...
while(waited < waitAmount)
{
if(!isYRunning)
{
waited += Time.deltaTime;
}
yield return null;
}
waited = 0;
}
Notice that we only increment the waited
time if Y is not running.