I know how to make a script that just pushes you back, but not one that has someone else engage you. I'll show you a script I wrote that I think is what you want (NOTE: It's using XSE 1.0.0...if you have the updated version you'll need to edit the syntax a bit):
setvar 0x7000 0x1 <-you need to set the var# of this script to match this variable
checkflag 0x822 <-this checks for the winning flag. For the boulder badge I believe its 0x821, but you need to check...
if 0x1 goto @win
applymovement MOVE_PLAYER @look
applymovement MOVE_PLAYER @done
setvar 0x7000 0x0 <-this resets it so it'll happen again if you keep trying to get past
#org @look <-you'll want to change the movements to fit what you need...
= The door is locked[.]\nThere is a note here:\p"Business in CINNABAR.\nBe back soon.\p-Daisy"