Hello!
This will be hooked to teh_content wp filter, acting upon teh post content before it's sent to the browser, and not by modifying the actual post content as seen in wp-admin, so there's no difference between old and new posts here. It can be make in a way to do differentiate between the two if needed though.
It can be a function to add directly to the theme you are using, or, possibly better, wrapped up as a plugin, so not to touch the theme at all, and accomplish teh same effect.
Kind Regards,
Dobri