<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def doScript(self, script_name, params=None, return_all=False):
 		"""This function executes the script for given layout for the current db."""

		request = [
			uu({'-db': self._db }),
			uu({'-lay': self._layout }),
			uu({'-script': script_name})
		]

		if params:
			request.append(uu({'-script.param': params }))

		request.append(uu({'-findall': '' }))

		result = self._doRequest(request)
		result = FMResultset.FMResultset(result)

		try:
			# Try to return results from the script
			resp = result.resultset if return_all else result.resultset[0]
		except IndexError:
			resp = None

		return resp