I'm probably stating what you may already know, and I haven't tested it:

Set enable_polycollision
remove the my.z_offset part of the code
replace trace with c_trace and ent_move with c_move.
Make sure in your c_trace you are using the correct trace mode, with use_box etc, and make sure enable_polycollision is set to a working value.

You may do all that and it still may not work, but it's somewhere to start