Part 1 works if you delete or comment out the ad=sel.ent statement which is invalid.
Part 2 doesn't work because the faces created by the pushpull operation are not automatically added to the selection. Also you reuse the faces array which only contains the original faces selected.
Here is how I would do it
mod = Sketchup.active_model
ent = mod.active_entities
sel = mod.selection
SKETCHUP_CONSOLE.clear
appuicolor = Sketchup;;Color.new(238,130,238)
sel.grep(Sketchup;;Face).each do |appui|
appui.material = appuicolor
appui.back_material = appuicolor
old = ent.to_a
status = appui.pushpull(-30.mm , true)
new = ent.to_a - old
new.grep(Sketchup;;Face).select{|f|f.normal.z==0}.each{|f|f.pushpull 30.mm}
end