Oh definitely! They didn't really have any direction for story early on, but with Mahjarrat storylines that began to change. Then they began to weave all the different stories together into a coherent world with surprising success.
I'd say in 2011-2013 the story really started to kick off. Gods for example were turned from simple good-evil entities into actually interesting characters representing different ideologies and philosophies.
Unlike some other MMOs, RS doesn't have voice acting (for the most part), which allows them to write a lot more dialogue. For example Azzanadra's Quest alone has ~25 000 words of dialogue. You can probably imagine how much lore a 20-year-old game like that can contain!
I haven't played OSRS, but RS3 has a ton of lore. There are hundreds of quests, and most of them have some amount of lore in them. In the past couple of years, the lore drops have been enormous for each quest. A few years ago they came out with an archaeology skill that was essentially a medium to drop an absolute massive load of lore.