There is no need to be a quandary over awhile versus a while. It can always be two words.
It has to be two words after a preposition and in "a while ago" and "a while back."
...there for a while...
...called in a while...
...saw him a while ago...
...remember it from a while back...
English has something called an "adverbial objective." It is a noun that can be used as an adverb. A while is a noun and can be used to answer the question "how long," which is an adverb. It is two words as a noun.
...spent a while with him...
...together a while there...
Dilemma solved! Take awhile out of your dictionary. It is always correct as two words.
Happy punctuating!
Margie