A simple motor or generator simply add inertia, but I see no reason why you can't use a flywheel to deliberatly regulate frequency, for example by adding a continuously variable transmission.
But really inertia is all you need because all we are trying to do here is replacing the lost inertia from replacing spinning generators with solar. The recovered inertia gives human operators the time to make phone calls to increase energy production, spinning up a pumped-hydro plant or whatever is available.
Who is going to pay to build and operate this flywheel inertia plant that generates no power? Sure it is possible but if you are going to spend that kind of money you can do a lot better.
It's been done already! Beacon Power operates a 20 MW / 5 MWh flywheel plant in Stephenstown, NY that does nothing but store grid energy and release it when needed. And ancillary services such as spinning reserve carry a price on the electricity market, so there is definitely an opportunity there.
I'm not sure if frequency regulation is currently considered an ancillary service in electricity markets right now though - from what I know about NY state, only 10- and 30-minute reserve are priced.
The same people that would alternatively pay for smart grids: grid operators tha want to prevent blackouts in a changing environment. It's just another piece of infrastructre next to power lines and countless substations and transformers.
But really inertia is all you need because all we are trying to do here is replacing the lost inertia from replacing spinning generators with solar. The recovered inertia gives human operators the time to make phone calls to increase energy production, spinning up a pumped-hydro plant or whatever is available.