It could certainly be refactored to improve code quality, it would just take more time.
If you want to contribute to the repository, I would be thankful.
As for ZX-BASIC, please see this discussion on SMSPower:
https://www.smspower.org/forums/20954-BASICCompilerForTheSegaMasterSystem