I don't agree with your friend's comment that this form is ' old fashioned and is barely used any more.' This is not a question of fashion, but of basic grammar.
'A while' is a noun phrase meaning 'a certain period of time'. Grammatically, 'a while' is the same as 'a year' or 'a moment'. It's a noun phrase consisting of an article (a) and a noun (while). You would say for example:
'Wait a minute'.
'Wait a while.'
You wouldn't say 'Wait aminute', would you? So there is no reason to write 'a while' as one word, either. This is logical.
'I haven't been there for a long time'
'I haven't been there for a while'
It would be wrong to write 'for along time' here, wouldn't it? And it's equally wrong to write 'for awhile'. Articles are NEVER attached to nouns.
American English does have an adverbial form 'awhile'. British English doesn't. So it would seem to me that the best advice - whichever type of English you use - would be to always write this as two words. A while. This will always be correct. There is never any need to connect the two words.