No ,script does not automatically find the memory pin name.
If the memory pin name at top design is different from "mem_", you need to change the prefix of pin name in pin assignment tcl file.
For example, If the memory interface pin names in your top level design are with the prefix top_mem_*, you need to change the following line in the <instance_name>_pin_assignment.tcl script.
From
if {![info exists pin_prefix]} {set pin_prefix "mem_"}
to
if {![info exists pin_prefix]} {set pin_prefix "top_mem_"}
If you have generated the controller in SOPC Builder, you need to make changes to the line below in <instance_name>_pin_assignment.tcl script.
From
if {![info exists sopc_mode]} {set sopc_mode YES}
to
if {![info exists sopc_mode]} {set sopc_mode NO}