Hi irvine
stonefly's need their skin to dry out before they hatch
just like damsels so they crawl to the edge and up some structure
as previously mentioned.
As Richard says they were most probably egg laying
as only the females can fly. Some of the stones lay their eggs by crawling subsurface, others by dipping their abdomen.
They are not the best fliers so the skittering is quite common as they try to take off
I imagine if they head to shore whilst trying then they hedge their bets on survival
cheers
sandy