You start with a header 'Coding in Blender' you mention 'manage events in blender', I'm not sure what you mean.
Do you mean 'How to write a script to complete actions in Blender?'
Check out Creating a Voxelize Script - CG Cookie to start with
when writing your own script use Blender 2.92.0 Python API Documentation — Blender Python API for a resource.
While you can absolutely write scripts that contain functions and loops to do all sorts of cool stuff in Blender, it's important to note that it's not a game engine and does not play by the same rules that you might expect if you're coming from Unity or Unreal. Because there is no gameplay mode, the concept of events doesn't really apply.
You may want to look Three.JS if you're wanting to work in Javascript: Creating a scene – three.js docs (threejs.org)
I haven't used it myself, but it's a good standard for 3D on the web.