Controlling the engine output power by varying inlet or exhaust valve operating characteristics, e.g. timing during engine operation