I have found this used Specialized Diverge(aluminium frame) and am wondering how bad this scratch/dent on the side of the top-tube close to the seatpost is. I have looked at other posts and I don't think it is dangerous now, but how big is the risk that it will get worse?
It can be hard to judge damage from a photo, as it is in 2D and you can't control the lighting or the viewing distance. There doesn't look to be much depth to the dent, assuming it's not just paint.
In other contexts, you might want to look for cracking around the dented area. Even little fractures in the metal surface would not be a good sign, but you have to distinguish cracks in the metal from cracks just in the paint. Here is one example where the viewer consensus is that any apparent cracks are likely to be paint deep only. The dent in that post is quite considerable compared to what I think I see in this question. That is, aluminum frames can be rideable after a fairly significant dent. Here is a different example where the consensus is that this is no longer rideable.
Another thing you might consider is to search Stack Exchange for examples of dented aluminum.