Ideally both but if you can only get one for now, then RE4 is the better deal.
Dead Space is a very atmospheric and competent sci-fo horror that I'd maybe want to replay at some point whereas I can't count how many times I've played RE4 so far.
I think five or six playthoughs, including one with a friend. I've done Hardcore first, then NG+, then Hardcore S+ Rank with pistol/knife only, then
Professional and now Assisted without healing and Merchant to have an easier time.
And I still haven't unlocked everything.
It's not only pretty long on a first playthrough but immensely replayable with loads of extra stuff, and then there's Separate Ways to top it off...
The excellent gameplay loop just lends itself to multiple playthroughs and challenge runs.
Needless to say, it was my GOTY and pure value for money in my case