I think this code is not omitting values where possible, and may need a little reworking.
inset(10px round 10px 20px 30px) should serialize as inset(10px round 10px 20px 30px) and not include the 4th border radius.

I think the serialize(values) function can be removed.