Does the expect command work after an su is executed in the script?
Does expect work by emulating the feeding of key strokes to the terminal?
Yes and yes, although the second bit ("emulating ... key strokes") is an oversimplification.