This should do it as a cronjob (now modified so as to work with any database prefix):
<?php
if ( !wp_next_scheduled( 'my_hourly_event' ) ) {
wp_schedule_event( time(), 'hourly', 'my_hourly_event' );
}
function kts_delete_members_at_eot() {
global $wpdb;
$args = array(
'role__in' => array( 's2member_level1', 's2member_level2', 's2member_level3', 's2member_level4' ),
'meta_key' => $wpdb->prefix . 's2member_auto_eot_time',
'fields' => 'all_with_meta',
);
$users = get_users( $args );
if ( empty( $users ) ) {
return;
}
$time = time();
foreach ( $users as $user ) {
$eot = get_user_option( $wpdb->prefix . 's2member_auto_eot_time', $user->ID );
if ( empty( $eot ) ) {
return;
}
if ( $time > $eot ) {
//wp_delete_user( $user->ID );
$user->set_role( 'subscriber' );
}
}
}
add_action( 'my_hourly_event', 'kts_delete_members_at_eot' );