If mental illness is defined as extreme difficulty functioning in the real world, then the complete inability to distinguish imagination from reality is surely going to increase the likelihood of mental illness. However, if one has an overactive imagination but also has the ability to distinguish reality from imagination and can harness these capacities to flourish in daily life, then that is far from mental illness.
Quotes are taken from the research journals of Kyle Vanderburg.