Indesign hiding Progress Bar under active window its processing

In this script, Indesign hides the Progress Bar when I want it to be showing… any help would be appreciated.

set ImageNameList to {}
set pageRefList to {}
set linkRefList to {}


my getLinkInfo(ImageNameList, pageRefList, linkRefList)

on getLinkInfo(ImageNameList, pageRefList, linkRefList)
	set rpt to 1
	try
		tell application "Adobe InDesign 2023"
			activate
			tell active document
				repeat with pageNo from 1 to (count of pages)
					set myrectangles to all graphics of page pageNo
					repeat with pageitem from 1 to (count of myrectangles)
						set ImageName to get name of item link of (item pageitem of myrectangles) as string --- gets the Image name from (pageitem) on page (pageNo)
						set pageRef to name of parent page of parent of link ImageName --- gets the Image page number of 'ImageName'
						set linkRef to file path of link ImageName --- gets the Link Reference Path of 'ImageName'
						
						copy ImageName to end of ImageNameList --- create list of image names
						copy pageRef to end of pageRefList --- create list of page numbers
						copy linkRef to end of linkRefList --- create list of link references
						
					end repeat
					
					set my progress total steps to (count of pages)
					set my progress completed steps to pageNo
					set my progress description to "Processing images"
					set my progress additional description to pageNo
					delay 5
					
				end repeat
			end tell
		end tell
	on error e
		my errorHandlerCancel(e)
	end try
end getLinkInfo

Your progress update statements are outside of the repeat loop so the progress bar is updated only at the end of the script.
And the InDesign statements needs to be improved a bit:

set imageNameList to {}
set pageRefList to {}
set linkRefList to {}

my getLinkInfo()

on getLinkInfo()
	
	tell application id "com.adobe.InDesign"
		activate
		
		set allGraphics to all graphics of active document
		
		set my progress total steps to (count of allGraphics)
		set my progress description to "Processing images"
		
		set x to 0
		repeat with aGraphic in allGraphics
			set x to x + 1
			if item link of aGraphic ≠ nothing then
				set end of my imageNameList to name of item link of aGraphic
				set end of my pageRefList to name of parent page of aGraphic
				set end of my linkRefList to file path of item link of aGraphic
			end if
			
			set my progress completed steps to x
			set my progress additional description to x
			
		end repeat
		
	end tell
	
end getLinkInfo