Actually, the laws vary from state to state. California's involuntary psychiatric hold is for 72 hours, which is in section 5150 of the Welfare and Institutions code (hence the term "5150" in various tv shows and movies). There are means for extending the hold past 72 hours if clinically indicated, though a court representative has to determine if there's probable cause for the extensions within 2-3 business days of each continuation. New York has a different method, wherein I believe two physicians have to agree that the person is a danger to self/others and can commit to a hospital for a significantly longer period of time, though the hold has to be legally reviewed within 10 days if/when the patient appeals the hold.
For Los Angeles County specifically (since Hollywood obviously is within the county), a hold can be written by county-trained medical professionals as well as by police officers, as the latter are usually the first to respond to a 911 call. From experience, they will definitely write a hold if someone has been presenting as depressed recently and has been actively researching suicide methods. Add to that if the mother pinpoints a recent stressful event (such as being left at the altar earlier that month), and there's absolutely enough reasonable doubt that a police officer on scene would write a hold or at least transfer the person to an ER for a psychiatric assessment. Given Rebecca's extreme funk pre-smoothie (as well as any flipping out she most likely would've done if removed from the house), an ER psychiatrist would also likely write a hold and transfer to a psychiatric unit for 72-hour observation.
On the other hand, had Paula and the gang succeeded in dragging Rebecca to an ER for a psych eval at the beginning of the "Swim-chan" episode, there likely would not have been enough cause to admit her involuntarily, since up to that point her actions (retreating to a hotel after the wedding, sending poop cupcakes that were returned, yelling at Josh in church, trying to defame him in a blog article) were not clearly a direct danger to herself or to Josh's life (though obviously were a cry for some mental help). An ER doctor at that time would have recommended that she see her own psychiatrist again very soon.
(Apologies for the double post. Still learning how to quote posts from two separate pages.)