poly inset

Hello everyone i want to create a script like this gif. Anybody help me?

This script makes any poly object to hallow object.