If you have 5 years of legal residence in Ireland regardless of the stamp then you are eligible to apply for
long term residency on your own right.
The process is explained here:
http://inis.gov.ie/en/INIS/Pages/Long_Term_Residency
I guess it will affect your naturalisation application because it was on the basis of marriage to an Irish national and you are currently ending that marriage. The good news is that once your long term residency is approved you don't have to worry about that anymore because you will be a permanent resident on Stamp 4.
Similar cases had their citizenship applications on hold until the long term residency was approved, once that was sorted their naturalisation application were successful.
I understand it's a scary situation and most people decide to withhold information regarding marriages ending from INIS but as I said before my recommendation is to come clear as soon as possible. If for some reason they find out your Stamp 4 will be revoked and the naturalisation application refused.
I am not a lawyer or immigration counselor, all views expressed are my own, my comments do not constitute legal advice.