With Latifi being 5 laps down at the end of the race, I wonder... if a Safety Car came in, and at somepoint 'Lapped cars may overtake' could Latifi have came back his 5 laps or would he unlap himself only once so staying a 4 laps down?
TL;DR: the main purpose of that rule is getting the lapped cars out of the way of the leaders during the restart by sending them to the back of the pack, it's not a rule allowing them to unlap themselves several times.
No, Latifi (or any other car in his situation) could not benefit from that in the way you described.
As the FIA's sporting regulation explains in article 39.12:
If the clerk of the course considers it safe to do so, and the message "LAPPED CARS MAY NOW OVERTAKE" has been sent to all teams via the official messaging system, any cars that have been lapped by the leader will be required to pass the cars on the lead lap and the safety car. This will only apply to cars that were lapped at the time they crossed the Line at the end of the lap during which they crossed the first Safety Car line for the second time after the safety car was deployed.
The main reason for that article is to get the lapped cars out of the way of the leaders. For instance, imagine a potentially thrilling restart having Hamilton in first place, Bottas in second but, between them, a slow backmarker Williams. That would ruin any chance of Bottas challenging Hamilton during the restart. That's the only reasoning for that rule, which was re-implemented in 2012 (article 40.12 back then) after being dropped in 2009.
You could argue that the situation you described is not specifically and explicitly mentioned in the rule, but since the very objective of that article is clear to FIA and all drivers/teams this very specific detail is not exactly necessary. On top of that it's worth saying that if your scenario were possible the article should mention it, indicating that cars several laps down could overtake the leader several times. Finally, to make your scenario even more impossible, the rule clearly says Latifi can "pass the cars on the lead lap", so if there is another car 1 or more laps down in front of him Latifi could not overtake it (not even once).
Therefore, in that situation, the Williams would overtake and rejoin at the back of the field, thus not getting in the way of the leaders anymore (again, the whole objective of that article), but it would be able to unlap itself only once.
I'm sure there must be a precedent for this situation, but I haven't been able to find one yet. However, my expectation is that dly is right: cars that are multiple laps behind can only unlap themselves once.
Allowing lapped cars to overtake generally causes a safety car period to get extended for a lap or so beyond the point where the track is actually safe again, while they wait for the lapped car to catch up to the back of the pack (or at least, get sufficiently far down the track from the leader). Waiting for a driver who's five laps down to unlap himself five times would make the safety car period ridiculously long, and while he's doing that, everyone's tyres will be going stone cold, which will cause problems when they get going again.