The rattle you mentioned indicates that something might be loose. That might also be a result of a badly damaged catalytic converter that definitely needs to be replaced. So you should have your mechanic put your car on the lift and eyeball the situation.
If you’re lucky, something else is rattling. If that’s the case, then I would say you should try the high octane fix, especially since you say your check engine light has been on and off for two years. That would indicate that the unit just needs a good cleaning that a tank full of high octane would do. But first get that rattle checked out.