Therefore in order to try your script I reverted back to assuming an ESP_Basic default AP address of 192.168.4.1 - and find that your script runs correctly and does what is expected, so I suggest you should start by doing likewise.
I modded your script to use the ESP_Basic default AP subnet broadcast address of 1902.168.4.255. Run it, then click Local Set button in debugger utility, which should then set the utility to local address of 192.168.4.2
Once you've got your node broadcasting on the same subnet as the utility is configured for, it should then receive your udp incrementing counts. I've added a udpreply "stopped" acknowledgement for obvious clarity.
'listening port
udpbegin 5001
ret = " "
'where the program will branch on UDP message reception
udpbranch [udp]
for i = 1 to 10000
udpwrite "192.168.4.255", 5001, str(i)
serialprintln ret
next i
end
[udp]
ret = udpread()
if ret = "stop" then
udpreply "stopped"
end
endif
return