Problem is knowing if you are really mentally stable. Not because you function on a normal basis would already classify you as mentally stable; being one means you are confident with controlling your own emotions, and other aspects of you. If OP refers to people who are diagnosed with mental health conditions and disorders, then that's actually a no. They might be able to divert their attention but they are more prone with addiction on the same instance. But on our ends even if we are often encountering emotional distress, we can still gamble; managing your betting habits will be another story.
My question now is are there any moral, ethical or legal obligation to bar a person from gambling after physically observing that he is mentally unstable?
No, you can " never judge the book by its cover".. That's the Dhar Mann vibes. But seriously, as long as the person is behaving, he should be allowed to gamble, it's entertainment after all, right? so everyone deserves to be entertain as long as he can pay the play.
As kong as he thinks rationally, then it would be fine 'coz he will still be aware of what is right and what is wrong or when to stop and continue. With being prone to addiction, it depends on your mindset as a gambler. If you are taking too much risk on a daily basis, then you should avoid this industry. Entertainment is far different from vices and that is the bottomline between these two.
My question now is are there any moral, ethical or legal obligation to bar a person from gambling after physically observing that he is mentally unstable?
Gambling is for everyone. I believe if that person life is not being affected badly then I don’t find the need to ban them on gambling which probably gave them entertainment despite they have some mental problem.
In your example, the subject is a regular which means he is doing it for a long time without any problem. The situation might be worst if you stop them playing which they regularly do since they are mentally unstable.
More importantly on this topic. If mentally unstable still can enjoy the game then they should be allowed to play or else they will be discriminated.
What about the consequences of losing? Gambling is not only for entertainment 'coz if that's so there are for sure other outlets for enjoyment such as console games which are alike with it and not involving real money which could even yield to debt if they'd be lacking sense of control on their losses.