Excellent question... I am glad you are there to care for your friend. To be honest, the best course of action is going to be to call the police again. Tell them that he has seemed dangerous to you - even if it is only a danger to himself (which he has been if he has been so paranoid that he is roaming around on the roof - very unsafe). I know that seems a bit drastic, but they can initiate an emergency psychiatric hold for your fried. The Emergency Room doctor did you a disservice with the diagnosis and recommendation, and for that I am sorry... but the police will be able to begin a different process so your friend can be properly evaluated and treated.
Sorry to tell you to do something so drastic, but his safety is the primary concern, and they are in the best position to help. If you do not feel you can accomplish that, then take him to the ER again and insist upon a psychiatric consult - he needs to be triaged by the psychiatric workers before he gets released again (you may wish to use a different hospital this time!). I wish you the best of luck - If you are satisfied with the response, please hit "Accept." That is the only way I can receive credit for my answer. Thanks-