240's run better with higher octane fuel... it even says in your manual to use high octane fuel.. most people I know can run midgrade without a noticeable difference in proformance. Those same people have also used normal unleaded and their cars would run really rough... I doubt running lower octante gas will help with your smog test.. Lower octane fuel is easier to burn.... Because of the high compression in the 240sx engines you can end up with detonation... which is not good!!
http://www.misterfixit.com/deton.htm here is a good write up on it.. with all the info on why NOT to use 87 in your 240... "The octane rating of a given grade of gasoline is a measure of its detonation resistance. The higher the octane number, the better able the fuel is to resist detonation. Most engines in good condition will run fine on regular grade 87 octane fuel. But engines with high compression ratios (over 9:1), turbochargers, superchargers, or with accumulated carbon deposits in the combustion chamber may require 89 or higher octane fuel." As far as racing fuel... depends on your setup.. are you running turbo? what mods do you have in the car? Racing fuel might help! and When I say racing fuel I mean High octane fuel 93+.... Do a tune up on your car.. check your O2 sensor if it's bad it can screw up your emissions and make the car run rough.. plugs/wires.. Clean your MAF Clean your AIV if you have one! if the AIV is dirty it can mess up your emissions and make your car run rough also.. if you have a bad Cat then you need to get a new one... and ubernoober learn some manners..