Slot 4 is the best choice when playing against Snake, and to a lesser extent Link and Toon Link. And to a negligible extent, Peach.
The reason is that if both characters are in a grab (eg Snake is grabbing Pikachu) and they get hit by an external force (eg Snake's grenade), they will both receive the damage but the one with the lower port (port closer to 1) will receive the knockback, and the other will stay on the ground.
So if Snake is port 1 and Pikachu is port 4, and Snake grabs Pikachu and then a grenade explodes and hits both of them, Snake gets sent in the air and Pikachu stays on the ground.
So the reason I also mentioned Link and Toon Link is because they have bombs, and Peach cause she has a very small chance of pulling a bob-omb when she uses downB. I think it's like a 1/200 chance, not sure.
In doubles, any character can provide an external force. eg MK is grabbing Diddy and MK's partner (Snake) comes and utilts both of them. If MK has the higher port he doesn't receive any knockback (I think), whereas Diddy does and he dies because lolsnakeutilt.
Other than external forces, ports don't matter much. The only thing I can think of that matters is that if both characters grab each other at the same time, the one with the lower port (closer to port 1) will grab the other.
eg if Falco is port 1 and Lucario is port 4 and they press the grab button on the same frame (cause with both of them, the grabbox comes out on frame 6) then Falco will end up grabbing Lucario.
TL;DR Port 4 is better when your opponent Snake TL or Link
Port 1 is better when your opponent is any other character