You are checking the intital value attribute of the input_number in your trigger and condition. This is a value you configured when you set up the input number and it is not going to change. All it does is reset the input number to that value when home assistant is restarted or the integration is reloaded. You want to check the state of the input number, like this:
This will trigger when the input number changes from anything to 1234. It will then toggle the light and reset the input_number (to 9999) for the next time you want to use it.