1 - the script is developed for use with later versions of SSIS packages. Check the dtsx for the string packageformatversion - if it is 6 or earlier, the xml is different and the nodes sought in the Cross Apply won't work as shown.
2 - the string <insert your target package here> in the script should be substituted with your target dtsx: e.g. c:\temp\mypackage.dtsx or \\server\share\pkgfile.dtsx because that's what the OpenRowSet command will work on. It treats that file as a single bulk load, so the filename and pathing has to be just so, or it will choke.
3 - permissions - openrowset command may not be available to some logins. Use an administrator equivalent strength SQL account or AD user.
Hope this assists.