Could a solenoid be constructed to mimic the proper valve position vs time curve of a engine cam shaft? Maybe a circuit and/or several coils in each solenoid?
That's the only problem but it may be tricky or impossible to build such a solenoid that works well over all rpms. But if it could be built, it could be mass produced very cheaply, maybe cheaper than a cam shaft.
The other concerns such as force necessary to accelerate valves (are solenoids orders of magnitude more inefficient than cams?) and mangled valves from electronic failure (like other fail safe systems set the default of every valve in a safe position) shouldn't be problems.