I had an script agent until our contract expired in the first year of the pandemic and neither one of us tried to extend it. She reps for both stage and screen and while she's a very nice person and a successful agent we've never really had any success together, and that's okay.
I've heard that some people do get script agents by querying, but in my experience it seems like most script and stage agents get their clients through networking and in person interaction. I know a lot of agents go to workshops and things like Burning Man. I was "Discovered" at a fringe fest in Boston.
For what it's worth I still wasn't able to get a musical produced even with an agent. Its insanely difficult to get a movie or a stage play produced without some sort of exiting IP attached.
If you're interested this the story of how Hadestown, which is only the fourth time in Broadway's history at a woman wrote the music and book for a musical. It was super hard for her to get one of the most successful shows of recent years actually produced.