Since the document that you have is signed by your grandchild's mother before a notary public allowing you temporary legal custody of the child from what you have written it appears to be a valid document allowing you custody. To be sure it is recommended that you consult with a family law attorney to actually review the document.