If I correctly understand the issue, then a feature similar to what you described already exists in Metamath-lamp. In order to change a justification, you may do the following:
Click the “Unify all” button.
In the text field “Label of root justification” select another assertion you want to use. It is enough to type only a part of another assertion name.
If the new assertion requires another set of arguments, then make sure the parameter “Allowed statements: first level” is set to “All”. If the arguments are the same, then you may leave this parameters as is.
Click the “Prove” button.
If a proof is found then clicking the “Apply” button will modify the justification in the editor to use the new assertion you selected.
Here is a short demo - https://drive.google.com/file/d/1R4waaGFS2WUT-Apq7RMXVuaUIJMVhh8q/view?usp=sharing
–
Igor