When I was performing salatul Isha, I stood up and near the end of my 3 tasbihat al arba’A (the 4 dhikrs), I started having doubts whether if this was my 4th or 5th rakah, so then as I went to sajda, I was somewhat certain it was my 5th in my ruku, then somewhat certain it was my 4th in my sujood, but again I wasn’t sure, I did sajdata sahw, then I checked sistani’s website and it said I needed to sit back down and do salatul ihtiyat, so I did it, but I didn’t sit down in my prayer, instead I kept going, is my prayer valid for not knowing such thing?

No. It’s invalid..
You need to remake it