What was it that the strings came from that he got his foot tangled-up in? The reason I ask is because this is an extremely common problem that happens whenever people have anything inside of their bird's cages such as any type of Beds/Triangle Beds, Tents, Hammocks, and especially the Cuddle/Snuggle Huts...If you have ANYTHING like this inside of your bird's cage you need to remove it immediately and never ever put anything like this back inside his cage again...There are actually 2 reasons why you cannot keep anything like this inside of your bird's cage, #1 is that any small, dark places like these things create (including any type of boxes as well), as well as any nesting-material, will all cause their hormones to go crazy and can result in aggression and other issues, but #2, more importantly as you found out, is that they often result in the death of the bird. They either get tangled-up in loose-threads that suddenly start fraying, getting either their legs tangled-up in them or their necks, hanging them...OR they eat tiny little bits of the material over a long period of time, and since it's totally not able to be digested by them at all, eventually it builds-up enough that it causes a complete Bowel-Obstruction, Crop-Obstruction, etc. and kills them. There have been thousands of pet parrots killed by all kinds of fabric Beds, Tents, Hammocks, and Huts that are actually made for birds, there's a class-action lawsuit against the 2 main manufacturers of the "Snuggle/Cuddle Huts" due to how many birds they have killed, so if this is what your bird got his leg caught in or anything similar that you have inside of his cage, please make sure you remove it immediately and do not replace it. He'll be fine without it. If it was from something outside of his cage, just make sure it's taken care of and he no longer has access to it...
***As far as his foot/leg goes, keep a very close eye on it, check on it several times a day, and if ALL of the swelling is not completely gone in another day or so you need to get him to either a Certified Avain Vet or Avian Specialist Vet ASAP...If you see any signs that his leg, foot, or toes are turning either blue or black in color he needs to go immediately, as that's an emergency. Same thing if you see his toenails on that foot turning black or blue in color. If the swelling suddenly starts to gets worse it's an emergency. So the foot/leg should return to the normal size and color within 24-48 hours of that happening, if it doesn't then it means that the blood circulation below where the thread was wrapped around the leg was cut-off for too long and the tissue started to die due to getting no oxygen for too long. So if it's not back to normal by tomorrow or it gets at all worse then you need to take him immediately...