In order to have standing to bring an action for physical custody as a grandparent the children must have been living with you for a period of 12 months or more. That being said there is a section of the law that would allow you to pursue an action if:
A grandparent has standing to bring a petition for physical and legal custody of a grandchild. If it is in the best interest of the child not to be in the custody of either parent and if it is in the best interest of the child to be in the custody of the grandparent, the court may award physical and legal custody to the grandparent. This subsection applies to a grandparent:
(1) who has genuine care and concern for the child;
(2) whose relationship with the child began with the consent of a parent of the child or pursuant to an order of court; and
(3) who for 12 months has assumed the role and responsibilities of the child's parent, providing for the physical, emotional and social needs of the child, or who assumes the responsibility for a child who has been determined to be a dependent child pursuant to 42 Pa.C.S.A. Ch. 63 (relating to juvenile matters) or who assumes or deems it necessary to assume responsibility for a child who is substantially at risk due to parental abuse, neglect, drug or alcohol abuse or mental illness. The court may issue a temporary order pursuant to this section.
What this means is that if you have assumed the role of a parent for 12 months you may also bring an action for custody.
That being said, standing only becomes an issue should be it challenged by the other party. If you petitioned for custody and no one questioned whether you had standing to do so it would not be an issue. However, if it was challenged and you did not meet the above criteria your petition could be thrown out of court.
I just saw the additional information that you had posted - you could seek out legal aid in your area or ask the courthouse for the forms needed for custody actions. They generally have paperwork for individuals who cannot afford lawyers.