There's a lot of ambiguity in your post. You state that the two solutions posted fail you but you don't explain how, why, or at what point your experience diverges.
I'd like to follow and attempt your example, but I'd need you to clarify some things...
Then select the Type Tool again and go the square and type:
What do you meant by "go to the square and type"?
Now align the two objects to the baseline of allan and peter respectively.
Which two objects? There's only one square, right? Is there relevance in aligning to both allan and peter ('respectively')? I'm not sure what that would prove over and above simply aligning an object with the baseline of text...one time. Can you clarify?
In any case, alignment is pretty much always facilitated by Smart Guides. No matter what the scenario, I can drag the text-baseline anchor and get Smart Guide feedback for alignment purposes.