Analysis of variable VHE gamma-ray emission from the hard spectrum blazar 1ES 1218+304