Depending upon your stock though this will not work as the revaluation is at average, so the cost adjusted affects all costs in stock, so although you may alter it to “x” it will be “y” due to average costing. [:D]
Not sure what you have tried! Basically there is no way around the issue, especially with average costing. Have you tried removing all the stock performing the revaluation and then bringing the stock back in? You could item journal the items out ensuring you select the offending transaction then book them back in at the correct cost to revalue the average correctly, but reading you post if they have sold the 50 returned on the credit memo you also need to credit this sale back in and alter this stock and re-sell it. To correct it is not easy, so I am not sure if you are looking for an easy solution or one that works, and depending upon everything processed and being undone will depend upon it working or not.