This script is very, very confused. You shouldn't need to play with warmode, and you're using 'last' target which can cause issues because 'last' can include your friendlies as well as enemies. It's better to use 'enemy' in this case. Regardless, if they have magic reflect on, this isn't going to end well for you. You might want to do a check in the middle of your script to see if you're paralyzed and do some counter measures if you are. Also, usually people wait a while before throwing an explosion potion. I'd suggest having it in another macro if possible, but if you want a one-and-done script then you'd probably want to do some waiting after using the potion.
You should have a targeting macro like this:
@getenemy 'enemy' 'gray' 'criminal' 'murderer' 'closest'
if @inrange 'enemy' 16
headmsg "You're attacking me!" 'enemy'
endif
And then this is my version of what you're trying to do.
//Before we run through this long code, lets check
//if we even have an enemy on screen.
if @inrange 'enemy' 16
cast 'paralyze'
waitfortarget 15000
target! 'enemy'
pause 500
if @findtype 0xf0d 'any' 'backpack'
useobject 'found'
waitfortarget 15000
target! 'enemy'
else
sysmsg 'You do not have any explosion potions!'
endif
attack 'enemy'
else
sysmsg 'Your enemy was not on screen'
endif