The dash light flickering is probably not related to the cylinder misfire and more than likely caused to due a defective dimmer switch or dimmer switch harness.
The cylinder misfire code P0305 is where the focus of this smog check diagnosis should be. A misfiring cylinder will cause your Kia's engine to stubble until high enough RPMs are reached to facilitate the turning of a "dead' cylinder. If in fact the cylinder is severely misfiring, you should see a lack of engine power at all RPM ranges.
The diagnosis should include checking for cylinder compression on all cylinders for variations, and if mechanically sound, inspecting for ignition or fuel related problems specifically with cylinder 5. More then likely a smog check repair station will conduct a complete diagnosis on all cylinders to calculate what is normal for this specific engine.
Possible faults may include a defective ignition system (spark plug or coil pack), defective fuel injector and/or low cylinder compression.