I understand where you are coming from, but don’t expect that optimizing an engine is a simple task of modifying a dozen line of code. however, in theory yes, it is possible, but it will take a lot of work. Two major factor need to be considered:
- logic brick
- graphic engine
logic brick doesn’t seems to be a major problem ever since the integration of bullet2 physics engine and the implementation of a ‘tick’ system. So unless there are tons of logic bricks, blender should run pretty decent. If you need complex expressions, use Python.
graphic engine will get an over-haul very soon, as the old blender opengl rasterizer will be replaced with the much powerful and faster OGRE3d graphic engine. So there is no need to work on the current graphics engine anymore, as it is deprecated.
in short, OGRE will significantly boost BGE performance (current alpha builds shows 200-600% speedup in raw triangle power)