Mine is working more or less in the same way, except that I didn't care about the mouse, so only keyboard and joystick.
Do you have a way of making it work together with time critical code like border removal? I implemented my new routine into my Pacmania game to see if it was better than the original one. It is definetly faster, but still it doesn't prevent the screen from jumping sometimes then a IKBD interrupt occures at a bad time. I tried to enable / disable the IKBD during the border removal part, but it didn't help 100%.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe