Hi,
you can't achieve that with PHP only since switching between the registration and guest form is done with Javascript, without reloading the entire page. You can find the Javascript code for this in the view file show_block_login from line 199 onwards.
If you study the code for a bit, you can see for example that the password field is given the variable pwd, which gets a display of "none" when the guest tab is selected (line 311).
If you want to add a custom message only when the guest form is selected, you could add your message in the view sub_block_login_registration wherever you want and give the html element a unique id. Then add it along with the Javascript in the view show_block_login, simply follow along with the pwd, everywhere it gets a display of none you want to show your message, and vice versa.
Hope that helps!