I had the engine in a C182 do horrible things once, it surged twice and then stopped making noise. I managed to get the engine going again, but as said before...
Step 1 :- Profanities.
Step 2 :- Procedures as per the POH
If the rough running does not go away, I would start with the mags and then move onto the fuel. Just remember, when playing with the fuel it can take a little while for some fuel to come through if you've run a tank dry or had an issue with a lack of fuel for some reason.