The real symbol for 5000 and 10000 are V and X, here changed for easiness of the script.
The script does check the validity of Roman inputs, but the max accepted value is 9999.