Well, look at your code:
the first "$chatusername=..." line, what does this do? It looks at $bbuserinfo[username] (Mike's Dad), replaces each space with an underscore, and then stores the edited value in $chatusername (Mike's_Dad)
The second line
again looks at $bbuserinfo[username] (Mike's Dad), removes each apostrophe, and the stores the edited value in $chatusername (Mikes Dad), overwriting the already existing value of Mike's_Dad

Since the first value was overwritten, $chatusername now has a value of "Mikes Dad".
Your chat only accepts the first part, before the space, meaning "Mikes Dad" will be logged in as "Mikes".
Back to the drawing board