The parameter you are adding the event function to, ke, is currently "reaction-scoped". If you change the scope of your parameter ke to be "model-scoped" you will be able to add the event function to ke. Note that you will have to change your EventFunction to from reaction2.ke = ... to ke = ....
This behavior is rooted in SBML standards but it would be helpful for us to understand why you want ke to be reaction-scped as opposed to model-scoped. Is there a particular reason why you want ke to be reaction-scoped?
Let me know if that helps.